Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Use of limit & marker parameters to glance list-images is broken #134

Closed
jimlindeman opened this issue Jul 11, 2014 · 1 comment
Closed

Comments

@jimlindeman
Copy link
Contributor

The logic in ImagesV2.on_get (in image/driver/sl/images.py) for handling limit & marker is fundamentally broken, primarily because the marker logic tries to set an inequality-based filter on the "globalIdentifier" but then fails to sort the results by that field. Because the results are not sorted by that inequality's field, certain images get reported multiple times and other images get skipped. Also the logic fails to actually check if the marker parameter passed in maps to a public or private image before starting with reporting from the proper set.

I dived into the code and found the current available parameters passed into the two Softlayer "get-images" APIs are described here:
http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getPublicImages
and
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getPrivateBlockDeviceTemplateGroups

Both of those calls lack a sort-field parameter, which is absolutely necessary in the current usage of the marker parameter being passed as an inequality-based filter shown in the code (as we need to be sorting by 'globalIdentifier'):
if marker is not None:
_filter['privateBlockDeviceTemplateGroups']['globalIdentifier'] = (
sl_utils.query_filter('> %s' % marker))

There seems to be at least three ways to handle this:

  1. Add sort parameter to those SoftLayer APIs and have Jumpgate specify that sorting if marker != None.
  2. Add the marker as a separate parameter to those Softlayer APIs and change Jumpgate to not specify it as an inequality-filter
  3. Just fetch the entire set of images from Softlayer (both public/private) without limit & marker parameters and apply the limit/marker logic in Jumpgate (very inefficient for reading large # of images in small chunks)
@jimlindeman
Copy link
Contributor Author

This is resolved by changes in issue #146

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant