Repository navigation
Conversation
Idle=True lets the keyspace controller turn a shard down, so it must only be set once every cell has been observed. Both ways of computing it enumerated cells with GetCellInfoNames, which lists the global cells/ directory. A cell's CellInfo is its only entry there, so a lost CellInfo dropped the cell from the listing entirely and a shard still serving in that cell could be reported idle. With the shard record present this went through topo.Server.GetShardServingCells, which additionally counted a listed cell without a CellInfo as not serving; without the record, #831's shardServingCells had the same blind spot for unlisted cells. Both paths now use shardServingCells, which also checks every cell in the VitessCluster (the shard's ZoneMap), so a configured cell whose CellInfo can't be read leaves Idle Unknown instead of being skipped. Fixes #863 Signed-off-by: Matt Lord <mattalord@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused change prevents unsafe idle decisions and includes regression coverage for both affected paths, with no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes #863 by checking configured cluster cells before declaring a shard idle, preventing unsafe turndown when a serving cell’s CellInfo is missing.
Changes:
- Uses
shardServingCellsfor both present and missing shard records. - Checks the union of topology-listed cells and
ZoneMapcells, leavingIdle=Unknownwhen a cell cannot be observed. - Adds regression tests for lost
CellInforecords on both reconciliation paths.
| File | Description |
|---|---|
pkg/controller/vitessshard/reconcile_topo.go |
Unifies serving-cell checks and includes configured cluster cells. |
pkg/controller/vitessshard/reconcile_topo_test.go |
Tests missing, unlisted CellInfo records with and without a shard record. |
Review effort: Balanced
|
Closing this, since it trades a very unlikely failure for a more likely one. The case it guards against is narrow. A cell has to lose its CellInfo while it still serves the shard, which takes a forced The fix also adds a new failure under A narrower version that requires only the cells where the shard has tablet pools ( |
Idle=True lets the keyspace controller turn a shard down, so it must only be set once every cell has been observed. Both ways of computing it enumerated cells with GetCellInfoNames, which lists the global cells/ directory. A cell's CellInfo is its only entry there, so a lost CellInfo dropped the cell from the listing entirely and a shard still serving in that cell could be reported idle. With the shard record present this went through topo.Server.GetShardServingCells, which additionally counted a listed cell without a CellInfo as not serving; without the record, #831's shardServingCells had the same blind spot for unlisted cells.
Both paths now use shardServingCells, which also checks every cell in the VitessCluster (the shard's ZoneMap), so a configured cell whose CellInfo can't be read leaves Idle Unknown instead of being skipped.
Fixes #863