-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
ALL
-
v5.3, v5.0
-
Sharding EMEA 2022-04-18
-
18
auth_add_shard.js is relying on removeShard to wait until the removed shard is fully drained before shutting down, however, remove shard works at the config server level, and it only checks if the shard has no chunks, so we might end up in a situation where the last migration just committed to the config server, but before cleaning up, which includes starting the source shard range deletion, removing the destination shard range deletion document and removing the migration coordinator document.
We should wait not only for the removeShard to be successful, but also to ensure there is no migration coordinator document on the donor shard, meaning, the last migration has successfully transfer the latest chunk to the destination shard, and all cleanup processes are finished.