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

ShardingTest causallyConsistent flag doesn't seem to enable causal consistency

    XMLWordPrintableJSON

Details

    • Fully Compatible

    Description

      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.

      Attachments

        Activity

          People

            misha.tyulenev@mongodb.com Misha Tyulenev
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: