Cinder volumes list issue when filter was used

Bug #1154454 reported by Qing Xin Meng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Feilong Wang

Bug Description

Issue #1
The param 'offset' is not supported.
Once the offset parameters was used, then the volume list will get a null output.

Issue #2
I found the integer checking for 'limit' and 'offset' should before the database query instead of the checking
during database query.

These issues were found during my V2 API test.
And for the v1 API, these issue was exist too.
I wondering if these issues will port to v1 API?

Recreate these issues.
===
http://9.123.99.189:8776/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/detail?limit=2

{
    "volumes": [
        {
            "status": "available",
            "attachments": [],
            "links": [
                {
                    "href": "http://9.123.99.189:8776/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/1acd7455-1392-4c01-bac6-c23c477b26ab",
                    "rel": "self"
                },
                {
                    "href": "http://9.123.99.189:8776/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/1acd7455-1392-4c01-bac6-c23c477b26ab",
                    "rel": "bookmark"
                }
            ],
            "availability_zone": "nova",
            "os-vol-host-attr:host": "dirpc5.cn.abc.com",
            "source_volid": null,
            "display_description": null,
            "snapshot_id": null,
            "id": "1acd7455-1392-4c01-bac6-c23c477b26ab",
            "size": 1,
            "name": "zhgongvolume1",
            "created_at": "2013-02-06T01:40:01.000000",
            "volume_type": "None",
            "os-vol-tenant-attr:tenant_id": "ee5e8069ff6e41c7ad4fbb0a965885c2",
            "metadata": {}
        },
        {
            "status": "available",
            "attachments": [],
            "links": [
                {
                    "href": "http://9.123.99.189:8776/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/f14035f1-a532-424c-91f5-a6f0ecdf07d8",
                    "rel": "self"
                },
                {
                    "href": "http://9.123.99.189:8776/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/f14035f1-a532-424c-91f5-a6f0ecdf07d8",
                    "rel": "bookmark"
                }
            ],
            "availability_zone": "nova",
            "os-vol-host-attr:host": "dirpc5.cn.abc.com",
            "source_volid": null,
            "display_description": null,
            "snapshot_id": null,
            "id": "f14035f1-a532-424c-91f5-a6f0ecdf07d8",
            "size": 1,
            "name": "test",
            "created_at": "2013-02-04T06:36:07.000000",
            "volume_type": "None",
            "os-vol-tenant-attr:tenant_id": "ee5e8069ff6e41c7ad4fbb0a965885c2",
            "metadata": {}
        }
    ]
}

http://9.123.99.189:8776/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/volumes/detail?limit=2&offset=1

{
    "volumes": []
}
===

Feilong Wang (flwang)
Changed in cinder:
assignee: nobody → Fei Long Wang (flwang)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24408

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/24408
Committed: http://github.com/openstack/cinder/commit/7c760581d80b2ee5cd1e01a1d0a007770c9aa807
Submitter: Jenkins
Branch: master

commit 7c760581d80b2ee5cd1e01a1d0a007770c9aa807
Author: Fei Long Wang <email address hidden>
Date: Thu Mar 14 14:35:10 2013 +0800

    Fixes Cinder REST API /volumes issue

    Issue #1
    Once GET variable 'offset' is specified, the API /volume will get an empty
    output.

    Issue #2
    Should validate the GET variable 'limit' before query database to get a
    consistent message with Cinder REST API v1.
    By current implement, error message is as below if the variable 'limit'
    is invalid:
    --------------------------------------------------------------------------
    {"computeFault": {"message": "The server has either erred or is incapable
    of performing the requested operation.", "code": 500}}

    After this change, the new message is as below:
    --------------------------------------------------------------------------
    {"badRequest": {"message": "limit param must be an integer", "code": 400}}

    Fixes Bug: 1154454

    Change-Id: Ifb155477bae0ea3e39877737ee9019e7d8a104a7

Changed in cinder:
status: In Progress → Fix Committed
Changed in cinder:
importance: Undecided → Critical
importance: Critical → High
milestone: none → grizzly-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/25249

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (milestone-proposed)

Reviewed: https://review.openstack.org/25249
Committed: http://github.com/openstack/cinder/commit/18e2c3542a6db98b1a71e50ed77b337ab179a0ba
Submitter: Jenkins
Branch: milestone-proposed

commit 18e2c3542a6db98b1a71e50ed77b337ab179a0ba
Author: Fei Long Wang <email address hidden>
Date: Thu Mar 14 14:35:10 2013 +0800

    Fixes Cinder REST API /volumes issue

    Issue #1
    Once GET variable 'offset' is specified, the API /volume will get an empty
    output.

    Issue #2
    Should validate the GET variable 'limit' before query database to get a
    consistent message with Cinder REST API v1.
    By current implement, error message is as below if the variable 'limit'
    is invalid:
    --------------------------------------------------------------------------
    {"computeFault": {"message": "The server has either erred or is incapable
    of performing the requested operation.", "code": 500}}

    After this change, the new message is as below:
    --------------------------------------------------------------------------
    {"badRequest": {"message": "limit param must be an integer", "code": 400}}

    Fixes Bug: 1154454

    Change-Id: Ifb155477bae0ea3e39877737ee9019e7d8a104a7
    (cherry picked from commit 7c760581d80b2ee5cd1e01a1d0a007770c9aa807)

Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-rc2 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.