← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1721791] [NEW] Pagination of instances works incorrect

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
         Status: New

** Description changed:

- 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.
-     
-     results = []
-     marker = None
-     while True:
-          servers = list_server(marker)
-          if not servers:
-              break
+ 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.
  
-          results.extend(servers)
-          marker = results[-1].id
+     # novaclient implements the same logic for `limit=-1`.
+     results = []
+     marker = None
+     while True:
+          servers = list_server(marker)
+          if not servers:
+              break
  
- Actually, novaclient implements the same logic for `limit=-1`.
- For some reasons, it stopped working. Listing instances starting from X instance returns a list of resources with X instance in it.
+          results.extend(servers)
+          marker = results[-1].id
  
- Catched by the scenario when 2 VMs are created at almost the same time
+ 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.

-- 
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):
  New

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


Follow ups