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

Do not return "set" name if not initiated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0-rc1
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Startup two 2.6 mongod's, and one 2.8 mongod, all the same replica set. Connect to one of the 2.6 nodes, and try to initialize the replica set. Bash history here:

      ➜  mongo git:(CAP-1250) ✗ ls /data/db                                                                                                                                                                                                                               (CAP-1250⚡)
      mixed_storage_and_version-0 mixed_storage_and_version-1 mixed_storage_and_version-2 mixed_storage_and_version-3 mixed_storage_and_version-4 mixed_storage_and_version-5 mixed_storage_and_version-6 sconsTests
      ➜  mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version                                                                                                                                                                                                              (CAP-1250⚡)
      ➜  mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node0                                                                                                                                                                                                        (CAP-1250⚡)
      ➜  mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node1                                                                                                                                                                                                        (CAP-1250⚡)
      ➜  mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node2                                                                                                                                                                                                        (CAP-1250⚡)
      ➜  mongo git:(CAP-1250) ✗ ./mongod-2.6 --dbpath /data/db/mixed_version/node0 --logpath /data/db/mixed_version/node0/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork                                                    (CAP-1250⚡)
      note: noprealloc may hurt performance in many applications
      about to fork child process, waiting until server is ready for connections.
      forked process: 12658
      child process started successfully, parent exiting
      ➜  mongo git:(CAP-1250) ✗ ./mongod-2.6 --port 27018 --dbpath /data/db/mixed_version/node1 --logpath /data/db/mixed_version/node1/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork                                       (CAP-1250⚡)
      note: noprealloc may hurt performance in many applications
      about to fork child process, waiting until server is ready for connections.
      forked process: 12670
      child process started successfully, parent exiting
      ➜  mongo git:(CAP-1250) ✗ ./mongod --port 27019 --dbpath /data/db/mixed_version/node2 --logpath /data/db/mixed_version/node2/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork                                           (CAP-1250⚡)
      note: noprealloc may hurt performance in many applications
      about to fork child process, waiting until server is ready for connections.
      forked process: 12682
      child process started successfully, parent exiting
      ➜  mongo git:(CAP-1250) ✗ ./mongo --port 27017                                                                                                                                                                                                                      (CAP-1250⚡)
      MongoDB shell version: 2.8.0-rc1-pre-
      connecting to: 127.0.0.1:27017/test
      > rs.initiate({_id: 'mixedVersion', version: 1, members: [{_id: 0, host: 'charlie-macbook-pro:27017'}, {_id: 1, host: 'charlie-macbook-pro:27018'}, {_id: 2, host: 'charlie-macbook-pro:27019'}]})
      {
      	"ok" : 0,
      	"errmsg" : "couldn't initiate : member charlie-macbook-pro:27019 is already initiated"
      }
      ./mongo --port 27019                                                                                                                                                                                                                      (CAP-1250⚡)
      MongoDB shell version: 2.8.0-rc1-pre-
      connecting to: 127.0.0.1:27019/test
      > rs.initiate({_id: 'mixedVersion', version: 1, members: [{_id: 0, host: 'charlie-macbook-pro:27017'}, {_id: 1, host: 'charlie-macbook-pro:27018'}, {_id: 2, host: 'charlie-macbook-pro:27019'}]})
      { "ok" : 1 }
      mixedVersion:OTHER> 

      Show
      Startup two 2.6 mongod's, and one 2.8 mongod, all the same replica set. Connect to one of the 2.6 nodes, and try to initialize the replica set. Bash history here: ➜ mongo git:(CAP-1250) ✗ ls /data/db (CAP-1250⚡) mixed_storage_and_version-0 mixed_storage_and_version-1 mixed_storage_and_version-2 mixed_storage_and_version-3 mixed_storage_and_version-4 mixed_storage_and_version-5 mixed_storage_and_version-6 sconsTests ➜ mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version (CAP-1250⚡) ➜ mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node0 (CAP-1250⚡) ➜ mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node1 (CAP-1250⚡) ➜ mongo git:(CAP-1250) ✗ mkdir /data/db/mixed_version/node2 (CAP-1250⚡) ➜ mongo git:(CAP-1250) ✗ ./mongod-2.6 --dbpath /data/db/mixed_version/node0 --logpath /data/db/mixed_version/node0/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork (CAP-1250⚡) note: noprealloc may hurt performance in many applications about to fork child process, waiting until server is ready for connections. forked process: 12658 child process started successfully, parent exiting ➜ mongo git:(CAP-1250) ✗ ./mongod-2.6 --port 27018 --dbpath /data/db/mixed_version/node1 --logpath /data/db/mixed_version/node1/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork (CAP-1250⚡) note: noprealloc may hurt performance in many applications about to fork child process, waiting until server is ready for connections. forked process: 12670 child process started successfully, parent exiting ➜ mongo git:(CAP-1250) ✗ ./mongod --port 27019 --dbpath /data/db/mixed_version/node2 --logpath /data/db/mixed_version/node2/mongod.log --logappend --smallfiles --noprealloc --nopreallocj --replSet mixedVersion --fork (CAP-1250⚡) note: noprealloc may hurt performance in many applications about to fork child process, waiting until server is ready for connections. forked process: 12682 child process started successfully, parent exiting ➜ mongo git:(CAP-1250) ✗ ./mongo --port 27017 (CAP-1250⚡) MongoDB shell version: 2.8.0-rc1-pre- connecting to: 127.0.0.1:27017/test > rs.initiate({_id: 'mixedVersion', version: 1, members: [{_id: 0, host: 'charlie-macbook-pro:27017'}, {_id: 1, host: 'charlie-macbook-pro:27018'}, {_id: 2, host: 'charlie-macbook-pro:27019'}]}) { "ok" : 0, "errmsg" : "couldn't initiate : member charlie-macbook-pro:27019 is already initiated" } ./mongo --port 27019 (CAP-1250⚡) MongoDB shell version: 2.8.0-rc1-pre- connecting to: 127.0.0.1:27019/test > rs.initiate({_id: 'mixedVersion', version: 1, members: [{_id: 0, host: 'charlie-macbook-pro:27017'}, {_id: 1, host: 'charlie-macbook-pro:27018'}, {_id: 2, host: 'charlie-macbook-pro:27019'}]}) { "ok" : 1 } mixedVersion:OTHER>

      Description

      Initializing a replica set with both 2.6 nodes and 2.8 nodes fails. The 2.8 node claims to be already initialized, without any existing data. I've attached how I set it up, and the logs of the mongod's. When initialized from a 2.8 node it succeeds.

        Attachments

        1. 27017.log
          52 kB
        2. 27018.log
          51 kB
        3. 27019.log
          12 kB

          Issue Links

            Activity

              People

              Assignee:
              scotthernandez Scott Hernandez
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: