-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 8.0.0, 8.3.0, 9.1.0-rc0, 9.0.0
-
Component/s: None
-
None
-
Catalog and Routing
-
ALL
-
馃煩 Routing and Topology
-
None
-
None
-
None
-
None
-
None
-
None
[Test only issue]
聽
Problem
In the ContinuousAddRemoveShard hook, after removing a shard, we decommission it, including a final sanity check validating all collections on the shard are empty.
聽
However this check always passes due to misuse of pymongo, there are at least 4 issues:
- In this line we run listCollections on a DB literally called "db_name", not the one referenced by the db_name variable.
- listCollections returns a dict {ok:1, cursor: ..., ...}. In this line we are iterating over the dict keys ("ok", "cursor", ...), not the collection names.
- In this line similarly we run find on a collection literally called "coll", not the one referenced by the coll variable.
- listCollections may return multiple batches but we never iterate them.
聽
The attached repro demonstrates a shard with non-empty collections is not detected by the hook.
聽
Proposed solution
Fix and test the hook code, and create tickets for any issues the fixed code may find.
- is related to
-
SERVER-134432 Decommissioning a removed shard can cause CMC to hit a tassert about a collection disappearing
-
- Closed
-
- related to
-
SERVER-134525 Inspect CAR test hooks for bugs where we misadvertently skip or ignore a validation
-
- Needs Scheduling
-