Bug #8638

[API] List queries using "distinct" option return incorrect number of items_available

Added by Joshua Randall over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
Start date:
03/04/2016
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

For example, on my system there are 54285 "arvados#link" entries, and this is what is returned for items_available for a generic query to select their names:

# arv link list -f '[["link_class", "=", "tag"]]' -s '["name"]' -l 0
{
 "kind":"arvados#linkList",
 "etag":"",
 "self_link":"",
 "offset":0,
 "limit":0,
 "items":[],
 "items_available":54285
}

Exactly the same results are returned when listing with the distinct option:

# arv link list -f '[["link_class", "=", "tag"]]' -s '["name"]' -l 0 -d
{
 "kind":"arvados#linkList",
 "etag":"",
 "self_link":"",
 "offset":0,
 "limit":0,
 "items":[],
 "items_available":54285
}

I've come across this while trying to write code that loops over all available items for arv-mount (to fix #8624), and finding that in this particular case, the query starts returning no items at offset 31749, suggesting to me that there are 31749 distinct tags in my system:

# arv link list -f '[["link_class", "=", "tag"]]' -s '["name"]' -d -l 1 --offset 31748
{
 "kind":"arvados#linkList",
 "etag":"",
 "self_link":"",
 "offset":31748,
 "limit":1,
 "items":[
  {
   "kind":"arvados#link",
   "name":"WGS" 
  }
 ],
 "items_available":54285
}
# arv link list -f '[["link_class", "=", "tag"]]' -s '["name"]' -d -l 1 --offset 31749
{
 "kind":"arvados#linkList",
 "etag":"",
 "self_link":"",
 "offset":31749,
 "limit":1,
 "items":[],
 "items_available":54285
}

History

#1 Updated by Brett Smith over 4 years ago

  • Subject changed from List queries using "distinct" option return incorrect number of items_available to [API] List queries using "distinct" option return incorrect number of items_available

#2 Updated by Brett Smith over 4 years ago

  • Target version set to Arvados Future Sprints

Also available in: Atom PDF