[SERVER-49550] Modify mongos_get_shard_version.js to uphold causal consistency Created: 16/Jul/20  Updated: 29/Oct/23  Resolved: 03/Aug/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Bug Priority: Major - P3
Reporter: Haley Connelly Assignee: Cathy Zhang (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-47260 mongos_get_shard_version.js assumes c... Closed
related to SERVER-50898 safe_secondary_reads_causal_consisten... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 21

 Description   

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.


 Comments   
Comment by Githook User [ 31/Jul/20 ]

Author:

{'name': 'Cathy Zhang', 'email': 'cathy2zhang@gmail.com', 'username': 'catzhang'}

Message: SERVER-49550 Modify mongos_get_shard_version.js to uphold causal consistency
Branch: master
https://github.com/mongodb/mongo/commit/9bef7faf716c807b1250ed7d726f97180773cc2b

Generated at Thu Feb 08 05:20:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.