{"record":{"id":"a51e74261e33394a","repo":"vitessio/vitess","slug":"getsrvkeyspaces-keyspace-s-w","errorCode":null,"errorMessage":"GetSrvKeyspaces(keyspace = %s): %w","messagePattern":"GetSrvKeyspaces\\(keyspace = (.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/cluster/cluster.go","lineNumber":1287,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GetKeyspaces(cluster = %s): %w\", c.ID, err)\n\t}\n\n\tvar (\n\t\tm            sync.Mutex\n\t\twg           sync.WaitGroup\n\t\trec          concurrency.AllErrorRecorder\n\t\tsrvKeyspaces = make(map[string]*vtctldatapb.GetSrvKeyspacesResponse, len(keyspaces.Keyspaces))\n\t)\n\n\tfor _, keyspace := range keyspaces.Keyspaces {\n\t\twg.Add(1)\n\n\t\tgo func(keyspace *vtctldatapb.Keyspace) {\n\t\t\tdefer wg.Done()\n\t\t\tsrv_keyspaces, err := c.Vtctld.GetSrvKeyspaces(ctx, &vtctldatapb.GetSrvKeyspacesRequest{Keyspace: keyspace.Name, Cells: cells})\n\t\t\tif err != nil {\n\t\t\t\trec.RecordError(fmt.Errorf(\"GetSrvKeyspaces(keyspace = %s): %w\", keyspace.Name, err))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tm.Lock()\n\t\t\tsrvKeyspaces[keyspace.Name] = srv_keyspaces\n\t\t\tm.Unlock()\n\t\t}(keyspace)\n\t}\n\n\twg.Wait()\n\n\tif rec.HasErrors() {\n\t\treturn nil, rec.Error()\n\t}\n\n\treturn srvKeyspaces, nil\n}\n","sourceCodeStart":1269,"sourceCodeEnd":1305,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/cluster.go#L1269-L1305","documentation":"Inside Cluster.GetSrvKeyspaces, each keyspace's srv-keyspace lookup runs in a goroutine; individual failures are recorded (not returned) via a concurrency.AllErrorRecorder with the keyspace name attached. The overall call still returns other keyspaces' results plus a combined error.","triggerScenarios":"Any per-keyspace Vtctld.GetSrvKeyspaces RPC failure — vtctld error, topo read failure, or context cancellation for that shard of work while fanning out over all keyspaces in parallel.","commonSituations":"Partial topo outage affecting some cells (Cells filter); transient vtctld overload during the parallel fan-out; a keyspace being deleted concurrently so its srv-keyspace entry vanishes mid-scan.","solutions":["Call GetSrvKeyspaces again — the error is recorded per-keyspace, so partial/transient failures often succeed on retry","Check vtctld and per-cell topo health for the failing keyspace's cells","Look at rec.Errors() for the full set of failed keyspaces, not just the first","Narrow the cells filter if a specific cell's topo is unhealthy"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"srv, err := c.GetSrvKeyspaces(ctx, req)\nif err != nil {\n\t// err aggregates per-keyspace errors; parse keyspace names from messages\n\t// and retry only the failed keyspaces\n\tvar aggr interface{ Errors() []error }\n\tif errors.As(err, &aggr) {\n\t\tfor _, e := range aggr.Errors() { /* retry per keyspace */ }\n\t}\n}","preventionTips":["Retry partial failures — fan-out errors are per-keyspace and often transient","Check per-cell topo health when using the Cells filter","Avoid deleting keyspaces during srv-keyspace scans","Monitor vtctld load during large fan-outs"],"tags":["vtadmin","rpc","vtctld","concurrency"],"backgroundTag":"vtctld-rpc-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}