-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 7.0.1, 4.4.24, 6.0.10, 5.0.21, 7.1.0-rc2
-
Component/s: None
-
Sharding EMEA
-
Fully Compatible
-
ALL
-
v7.1, v7.0, v6.0, v5.0, v4.4
-
Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16
-
3
If $out runs over a sharded collection after a movePrimary operation, $out will fail constantly with a StaleDbVersion until another operation refreshes the DbVersion on the new primary shard.
Events sequence leading to the bug:
- shard0 is the primary shard for mydb database.
- The sharded collection mydb.collA has chunks on shard0 and shard1
- A movePrimary for mydb is executed and the new primary is shard1.
- A $out operation over mydb.collA is launched and is redirected to shard1 as the primary of mydb.
- $out executes listCollection command here targeting shard0 because shard1 thinks it's the primary shard for mydb.
- The listCollection command fails with StaleDbVersion as expected and shard1 forwards the error to the router, so it never refreshes the DbVersion.