{"record":{"id":"37e1ea247d544594","repo":"vitessio/vitess","slug":"getshardreplication-v-v-v-failed-v","errorCode":null,"errorMessage":"GetShardReplication(%v, %v, %v) failed: %v","messagePattern":"GetShardReplication\\((.+?), (.+?), (.+?)\\) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/shard.go","lineNumber":109,"sourceCode":"\t\tcase topo.IsErrType(err, topo.NoNode):\n\t\t\t// No ShardReplication object. It means the\n\t\t\t// topo is inconsistent. Let's read all the\n\t\t\t// tablets for that cell, and if we find any\n\t\t\t// in our keyspace / shard, either abort or\n\t\t\t// try to delete them.\n\t\t\taliases, err = wr.ts.GetTabletAliasesByCell(ctx, cell)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"GetTabletsByCell(%v) failed: %v\", cell, err)\n\t\t\t}\n\t\tcase err == nil:\n\t\t\t// We found a ShardReplication object. We\n\t\t\t// trust it to have all tablet records.\n\t\t\taliases = make([]*topodatapb.TabletAlias, len(sri.Nodes))\n\t\t\tfor i, n := range sri.Nodes {\n\t\t\t\taliases[i] = n.TabletAlias\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"GetShardReplication(%v, %v, %v) failed: %v\", cell, keyspace, shard, err)\n\t\t}\n\n\t\t// Get the corresponding Tablet records. Note\n\t\t// GetTabletMap ignores ErrNoNode, and it's good for\n\t\t// our purpose, it means a tablet was deleted but is\n\t\t// still referenced.\n\t\ttabletMap, err := wr.ts.GetTabletMap(ctx, aliases, nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"GetTabletMap() failed: %v\", err)\n\t\t}\n\n\t\t// Remove the tablets that don't belong to our\n\t\t// keyspace/shard from the map.\n\t\tfor a, ti := range tabletMap {\n\t\t\tif ti.Keyspace != keyspace || ti.Shard != shard {\n\t\t\t\tdelete(tabletMap, a)\n\t\t\t}\n\t\t}","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/shard.go#L91-L127","documentation":"DeleteShard reads each cell's ShardReplication object to enumerate the tablets it must consider for deletion. Errors other than ErrNoNode (which triggers the tablet-listing fallback) reach the default case: the GetShardReplication operation failed in a way the code does not handle, so deletion aborts with the cell/keyspace/shard and underlying error.","triggerScenarios":"GetShardReplication returns a non-ErrNoNode error for a cell - topo server unreachable or timing out, permission error, corrupted node, or transient RPC failure while deleting the shard.","commonSituations":"etcd/zk timeouts during bulk shard cleanup; topo locks held by concurrent operations; network partition to one cell while deleting a multi-cell shard.","solutions":["Retry DeleteShard once the topo server for the failing cell is healthy.","Check for concurrent topo operations/locks on the shard and wait for them to complete.","Inspect the wrapped error to distinguish transport issues from corrupted ShardReplication data; repair the node if corrupted."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := ts.GetShardReplication(ctx, cell, keyspace, shard); err != nil && !errors.Is(err, topo.ErrNoNode) {\n    return fmt.Errorf(\"topo unhealthy for cell %s: %v\", cell, err)\n}","typeGuard":null,"tryCatchPattern":"err := wr.DeleteShard(ctx, keyspace, shard, evenIfServing, recursive)\nif err != nil && strings.Contains(err.Error(), \"GetShardReplication\") {\n    // wait for topo to recover / locks released, retry\n}","preventionTips":["Avoid concurrent topo mutations on the same shard.","Check topo server health/locks before shard deletion.","Retry transient topo RPC failures with backoff."],"tags":["go","topology","shardreplication","rpc"],"backgroundTag":"topo-rpc-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}