Registry db api marker implementation does not respect sort_key/sort_dir

Bug #819551 reported by Brian Waldon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Brian Waldon

Bug Description

Here are all the images in my registry:
curl 'http://localhost:9191/images?sort_key=name&sort_dir=asc'
{"images": [{"name": "aki-tty", "container_format": "aki", "disk_format": "aki", "checksum": "3ed2965d3f8d877a3ee3e061fd648e9a", "id": 2, "size": 4404752}, {"name": "ami-tty", "container_format": "ami", "disk_format": "ami", "checksum": "10047a119149e08fb206eea89832eee0", "id": 3, "size": 25165824}, {"name": "ari-tty", "container_format": "ari", "disk_format": "ari", "checksum": "2d222d406f3ed30e03ed44123c33cba6", "id": 1, "size": 5882349}]}

I begin pagination with limit=1 with no marker:
curl 'http://localhost:9191/images?sort_key=name&sort_dir=asc&limit=1'
{"images": [{"name": "aki-tty", "container_format": "aki", "disk_format": "aki", "checksum": "3ed2965d3f8d877a3ee3e061fd648e9a", "id": 2, "size": 4404752}]}

To move on to the next page, I should use marker=2. As indicated in the original query, image 3 should be returned. Image 1 is actually returned:
curl 'http://localhost:9191/images?sort_key=name&sort_dir=asc&limit=1&marker=2'
{"images": [{"name": "ari-tty", "container_format": "ari", "disk_format": "ari", "checksum": "2d222d406f3ed30e03ed44123c33cba6", "id": 1, "size": 5882349}]}

Related branches

Brian Waldon (bcwaldon)
Changed in glance:
assignee: nobody → Brian Waldon (bcwaldon)
status: New → In Progress
Jay Pipes (jaypipes)
Changed in glance:
importance: Undecided → Medium
milestone: none → diablo-4
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: diablo-4 → 2011.3
status: Fix Committed → Fix Released
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.