← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1721791] Re: Pagination of instances works incorrect

 

Reviewed:  https://review.openstack.org/510140
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=add69c05072b4ee7efd4e75debf2172ed2269c86
Submitter: Jenkins
Branch:    master

commit add69c05072b4ee7efd4e75debf2172ed2269c86
Author: Dan Smith <dansmith@xxxxxxxxxx>
Date:   Fri Oct 6 07:40:42 2017 -0700

    Always put 'uuid' into sort_keys for stable instance lists
    
    If we're listing by sort keys that yield many ambiguous results, we
    may exacerbate issues in client pagination because we're not even
    bound by insertion order given that we have multiple databases being
    queried in parallel. So, even if the client didn't ask for it, throw
    'uuid' into the end of sort_keys to provide us a stable ordering. This
    was done for the default case by always including 'id' in the default
    set of sort_keys, although a user could still break if they request
    their own keys.
    
    Note this also removes the recently-added explicit sort in the
    test_bug_1689692 case, since we're enforcing a strict ordering with
    this patch. Also, mriedem is awesome.
    
    Change-Id: Ida446acb1286a8b215451a5d8d7d23882643ef13
    Closes-Bug: #1721791


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1721791

Title:
  Pagination of instances works incorrect

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Listing of instances returns a limited number of resources. To list
  all instances, "marker" parameter can be used to list all the pages,
  i.e to obtain all the servers.

      # novaclient implements the same logic for `limit=-1`.
      results = []
      marker = None
      while True:
           servers = list_server(marker)
           if not servers:
               break

           results.extend(servers)
           marker = results[-1].id

  For some reasons, it stopped working. Listing instances starting from
  X instance returns a list of resources with X instance in it.

  Caught by the scenario when 2 VMs are created at almost the same time
  (<1sec between requests) in the same tenant by the same user, but with
  different names.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1721791/+subscriptions


References