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

Wrong error code from replSetInitiate with 0-vote arbiter

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc0
    • Affects Version/s: None
    • Component/s: Replication
    • Minor Change
    • ALL
    • Hide
      var InvalidReplicaSetConfig = 93;
      var replTest = new ReplSetTest({nodes: 3});
      var conns = replTest.startSet();
      var config = replTest.getReplSetConfig();
      config.members[2].arbiterOnly = true;
      config.members[2].votes = 0;
      
      var admin = conns[0].getDB("admin");
      
      jsTestLog('replSetInitiate with 0-vote arbiter:');
      var response = admin.runCommand({replSetInitiate: config});
      printjson(response);
      assert.commandFailed(response);
      assert.eq(response.code, InvalidReplicaSetConfig);
      
      Show
      var InvalidReplicaSetConfig = 93; var replTest = new ReplSetTest({nodes: 3}); var conns = replTest.startSet(); var config = replTest.getReplSetConfig(); config.members[2].arbiterOnly = true ; config.members[2].votes = 0; var admin = conns[0].getDB( "admin" ); jsTestLog( 'replSetInitiate with 0-vote arbiter:' ); var response = admin.runCommand({replSetInitiate: config}); printjson(response); assert .commandFailed(response); assert .eq(response.code, InvalidReplicaSetConfig);

      When I do replSetInitiate with a configuration that includes a 0-vote arbiter, I expect code 93, "InvalidReplicaSetConfig", not code 2, "BadValue".

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: