-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.9.0
-
Component/s: Sharding
-
Fully Compatible
-
ALL
On SERVER-54132 we realized that the orphans check at the end of the tests was not running due to this check for {dropped: false}. As this was fixed, it was uncovered that rename_sharded.js had orphans left around.
It happens when the rename runs after a move chunk that has not yet executed the range deletion. Temporarily, we changed the moveChunk to {waitForDelete: true} in the test.
Chosen approach (executed locally on each shard):
Precondition: moveChunks are blocked
- Get a list of source collection's persistent range deletion tasks
- Rename source collection to target
- Update _id (random) and nss (target) in the entries of the previously initialized list
- Persist range deletions tasks for the target collection
This is safe because:
- The SubmitRangeDeletionHandler observer will submit the new tasks to the range deleter
- Old tasks referring the source collection will be discarded by the range deleter because the namespace was dropped