Merge branch 'master' into 14715-keepprox-config
[arvados.git] / lib / controller / federation / list.go
index 43ed2cdbaad3d0750de97238cfc6596a4541a3ee..414870d24f5c42912785c4b29efa1fe4f91ec786 100644 (file)
@@ -68,8 +68,7 @@ func (conn *Conn) CollectionList(ctx context.Context, options arvados.ListOption
 //
 // * len(Order)==0
 //
-// * there are no filters other than the "uuid = ..." and "uuid in
-//   ..." filters mentioned above.
+// * Each filter must be either "uuid = ..." or "uuid in [...]".
 //
 // * The maximum possible response size (total number of objects that
 //   could potentially be matched by all of the specified filters)
@@ -140,6 +139,11 @@ func (conn *Conn) splitListRequest(ctx context.Context, opts arvados.ListOptions
                }
        }
 
+       // Collate UUIDs in matchAllFilters by remote cluster ID --
+       // e.g., todoByRemote["aaaaa"]["aaaaa-4zz18-000000000000000"]
+       // will be true -- and count the total number of UUIDs we're
+       // filtering on, so we can compare it to our max page size
+       // limit.
        nUUIDs := 0
        todoByRemote := map[string]map[string]bool{}
        for uuid := range matchAllFilters {
@@ -156,7 +160,7 @@ func (conn *Conn) splitListRequest(ctx context.Context, opts arvados.ListOptions
 
        if len(todoByRemote) > 1 {
                if cannotSplit {
-                       return httpErrorf(http.StatusBadRequest, "cannot execute federated list query with filters other than 'uuid = ...' and 'uuid in [...]'")
+                       return httpErrorf(http.StatusBadRequest, "cannot execute federated list query: each filter must be either 'uuid = ...' or 'uuid in [...]'")
                }
                if opts.Count != "none" {
                        return httpErrorf(http.StatusBadRequest, "cannot execute federated list query unless count==\"none\"")