-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
ALL
-
CAR Team 2026-08-31
-
0
-
🟥 DDL
-
None
-
None
-
None
-
None
-
None
-
None
Context. SERVER-130568 made reshard use a hashed key with 10 chunks. With a sharded collection, mongos splits the unordered bulk insert across shards rather than sending it all to one.
Problem. Drop is serialized with CRUD, but rename is not. If rename interleaves after some shards have committed their portion of the insert, the collection moves to a new name. Mongos retries the remaining batches against the old (now-empty) namespace, which implicitly recreates the collection. The post-insert count check then observes a partial document count instead of the expected all-or-nothing 0 or 60.
Precedent. SERVER-88111 / SERVER-95758 addressed the same check for the case where mongod splits a single insert into 64-doc batches. This is the analogous problem on the mongos side: the insert is split across shards, and a mid-flight rename can leave it half-applied.
Fix. Serialize rename with CRUD on the same collection. The same guard already applied to drop and a rename effectively drops the original nss, and it should be treated the same.Â
To not lose coverage, we could have a second test where rename an insert run concurrently, and have it built so that we can easily verify where the missing part of the batch wentÂ
- is related to
-
SERVER-88111 random_DDL_CRUD_operations.js bulk insert should perform max internalInsertMaxBatchSize inserts
-
- Closed
-
-
SERVER-95758 random_DDL_crud_operations.js might miscount if a bulk insert happens concurrently with a rename
-
- Closed
-
-
SERVER-130568 Add FSM support for background chunk movement
-
- Closed
-