vitessio/vitess · error
GetShardReplication(%v, %v, %v) failed: %w
Error message
GetShardReplication(%v, %v, %v) failed: %w
What it means
deleteShardCell returns this when reading the shard's ShardReplication object fails with an error other than ErrNoNode. The ShardReplication record is the authoritative list of tablets in the shard per cell; failing to read it aborts shard deletion for that cell.
Source
Thrown at go/vt/vtctl/grpcvtctldserver/topo.go:158
case topo.IsErrType(err, topo.NoNode):
// No ShardReplication object means that the topo is inconsistent.
// Therefore we read all the tablets for that cell, and if we find any
// in our shard, we'll either abort or try to delete them, depending on
// whether recursive=true.
aliases, err = ts.GetTabletAliasesByCell(ctx, cell)
if err != nil {
return fmt.Errorf("GetTabletAliasesByCell(%v) failed: %w", cell, err)
}
case err == nil:
// If a ShardReplication object exists, we trust it to have all the
// tablet records for the shard in that cell.
aliases = make([]*topodatapb.TabletAlias, len(sri.Nodes))
for i, node := range sri.Nodes {
aliases[i] = node.TabletAlias
}
default:
return fmt.Errorf("GetShardReplication(%v, %v, %v) failed: %w", cell, keyspace, shard, err)
}
// Get all the tablet records for the aliases we've collected. Note that
// GetTabletMap ignores ErrNoNode, which is convenient for our purpose; it
// means a tablet was deleted but is still referenced.
tabletMap, err := ts.GetTabletMap(ctx, aliases, nil)
if err != nil {
return fmt.Errorf("GetTabletMap() failed: %w", err)
}
// In the case where no ShardReplication object exists, we collect the
// aliases of every tablet in the cell, so we'll need to filter
// out anything not in our shard.
for alias, ti := range tabletMap {
if ti.Keyspace != keyspace || ti.Shard != shard {
delete(tabletMap, alias)
}
}View on GitHub (pinned to 01a25a7d17)
Solutions
- Check topo server health and connectivity from vtctld
- Inspect topo ACLs/permissions for the vtctld identity on the shard path
- Re-run DeleteShard after the transient error clears; it is safe to retry
- If the shard path is corrupt, inspect the topo directly (etcdctl/zkCli) and repair or remove the stale ShardReplication node
Example fix
// before vtctldclient DeleteShard ks/shard # fails while topo is down // after # verify topo, then retry vtctldclient GetShard ks/shard && vtctldclient DeleteShard ks/shard
Defensive patterns
Strategy: retry
Validate before calling
// Precheck shard replication readability
if _, err := ts.GetShardReplication(ctx, cell, keyspace, shard); err != nil && !topo.IsErrType(err, topo.NoNode) {
return fmt.Errorf("precheck failed for %s/%s in %s: %w", keyspace, shard, cell, err)
} Try / catch
err := vtctldClient.DeleteShard(ctx, ks, shard)
if err != nil && strings.Contains(err.Error(), "GetShardReplication") {
// transient topo error: back off and retry
} Prevention
- Ensure topo stability before bulk shard teardown
- Check ACLs on shard paths
- Retry idempotently: DeleteShard skips already-deleted tablets
When it happens
Trigger: Calling DeleteShard where ts.GetShardReplication(ctx, cell, keyspace, shard) returns a non-NoNode error: topo connection failure, permission error, or malformed shard path.
Common situations: Topo server outage during shard deletion; partial topo migration leaving keyspace/shard paths unreadable; wrong keyspace/shard spelling is NOT this (that yields NoNode, handled separately) but RPC/ACL errors are.
Related errors
- GetTabletAliasesByCell(%v) failed: %w
- error deleting ShardReplication object in cell %v: %w
- permissions diffs: %v
- GetShard(%s) failed: %v
- FindAllTabletAliasesInShard(%s, %s) failed: %v
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/135731e17ab75394.
Report an issue: GitHub.