Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80886

$out may fail with a StaleDbVersion after a movePrimary

    • 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.

            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            silvia.surroca@mongodb.com Silvia Surroca
            0 Vote for this issue
            4 Start watching this issue