[SERVER-16189] Do not return "set" name if not initiated Created: 17/Nov/14  Updated: 11/Dec/14  Resolved: 18/Nov/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.8.0-rc1

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 27017.log     Text File 27018.log     Text File 27019.log    
Issue Links:
Related
related to SERVER-16207 Add more heartbeat logging Closed
Tested
tested by SERVER-16508 Add stress test for mixed version and... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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> 

Participants:

 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.



 Comments   
Comment by Scott Hernandez (Inactive) [ 18/Nov/14 ]

commit: https://github.com/mongodb/mongo/commit/086893fa1ae5d561992be80ab4e85e34d37572c3

Comment by Scott Hernandez (Inactive) [ 17/Nov/14 ]

The hadData turned out to be a testing error on my part, so I added some logging to help out in the future. The real 2.8 issue was heart beat responding including the replica set name even when uninitiated.

Comment by Scott Hernandez (Inactive) [ 17/Nov/14 ]

The 2.8 node is returning "hasData" so it can't be init'd; looking into what it has.

Generated at Thu Feb 08 03:40:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.