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

Modify mongos_get_shard_version.js to uphold causal consistency

    • Fully Compatible
    • ALL
    • 21

      The findOne() in mongos_get_shard_version.js should be replaced with st.configRS.awaitLastOpCommitted() so the shard version before the moveChunk reflects the shard version after the both splits are applied and committed to the config servers.

      Context:
      mongos_get_shard_version.js performs two splitChunks, moveChunk and checks the version of the mongos at the end to make sure that mongos has the version right before the moveChunk.

      • The splitChunk commands in the test are sent directly to the shards.
      • Mongos does a force refresh at the beginning of moveChunk
      • SERVER-47260 added a findOne command against the config server to make the mongos advance its the config opTime and use that opTime as the afterOpTime when refreshing from the config server.
      • However, the config opTime used as the afterOptime when refreshing from the config server can lag behind the lastAppliedOptime and cause the final shard version to be 2 instead of 3.

            Assignee:
            cathy.zhang@mongodb.com Cathy Zhang (Inactive)
            Reporter:
            haley.connelly@mongodb.com Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: