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

Return a bad status when the MovePrimarySourceManager receives a bad return from commitMovePrimary

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.0.0-rc0
    • 3.7.5
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide

      (function() {
          "use strict";
       
          const dbName = "test";
       
          const st = new ShardingTest({shards: 2});
       
          assert.commandWorked(st.s.getDB("config").getCollection("databases").insert({_id: dbName, partitioned: false, primary: st.shard0.shardName}));
          print("config.databases entry for " + dbName + ": " + tojson(st.s.getDB("config").getCollection("databases").findOne({_id: dbName})));
       
          assert.commandWorked(st.s.adminCommand({ movePrimary: dbName, to: st.shard1.shardName }));
       
          st.stop();
      })();
      

      Show
      (function() { "use strict";   const dbName = "test";   const st = new ShardingTest({shards: 2});   assert.commandWorked(st.s.getDB("config").getCollection("databases").insert({_id: dbName, partitioned: false, primary: st.shard0.shardName})); print("config.databases entry for " + dbName + ": " + tojson(st.s.getDB("config").getCollection("databases").findOne({_id: dbName})));   assert.commandWorked(st.s.adminCommand({ movePrimary: dbName, to: st.shard1.shardName }));   st.stop(); })();
    • Sharding 2018-05-07

    Description

      I would expect, from the MovePrimarySourceManager::commitOnConfig() code, that if the commitMovePrimary command against the config server fails, then the donor shard primary will fassert.

      But, that doesn't seem to be the case (see repro).

      It's a separate issue whether we actually want the donor shard primary to fassert blindly here. We particularly may not want to it to fassert blindly, because a config.databases entry that's missing a database version will cause the commitMovePrimary to fail (which can happen if someone directly inserts into config.databases).

      EDIT: It turns out that the fassert does not work. We will just uassert instead.

      Attachments

        Activity

          People

            blake.oler@mongodb.com Blake Oler
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: