-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding, Testing Infrastructure
-
None
-
Fully Compatible
According to shardingtest.js the causallyConsistent flag does the following:
causallyConsistent {boolean}: Specifies whether the connections to the replica set nodes
But when the following test is run:
python buildscripts/resmoke.py enable-causal.py
enable-causal.js
(function() { const st = new ShardingTest({mongos: 1, shards: 2, rs: {nodes: 2}, config: 1, causallyConsistent: true}); jsTest.log("Is shard0 causal? " + st.shard0.isCausalConsistency()); jsTest.log("Is shard1 causal? " + st.shard1.isCausalConsistency()); jsTest.log("Is mongos causal? " + st.s.isCausalConsistency()); st.stop(); }());
The test prints "false" for all 3 statements. This seems buggy (or at least confusing). It would be more intuitive if the flag enabled causal consistency on the connection to the mongos, (since that's usually where most of the test's commands will go to) as well as on the connections to the shards.