-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 5.0.0, 5.1.0, 4.4.6
-
Component/s: Sharding
-
Fully Compatible
-
v5.0, v4.4
-
Sharding EMEA 2021-06-14
-
49
The SharingTest stop method is calling the check orphans hook without previously ensuring that top chunk migrations triggered by the chunk splitter have finished.
As a result, the following race condition can happen when the balancer is active:
- A migration stops on the receiving side, waiting for an overlapping range deletion to end
- The test finishes, ShardingTest.stop is called to shutdown the cluster
- The check orphans hook waits for range deletions to drain
- Overlapping range deletion finishes:
- The hook finishes waiting
- A new pending range deletion is enqueued and the clone of documents from the donor begins
- The hook misidentifies the just cloned documents as orphans