[SERVER-2622] updated replset config successfully, but isMaster still reports all config until server restart Created: 24/Feb/11  Updated: 12/Jul/16  Resolved: 28/Feb/11

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 1.9.0

Type: Bug Priority: Major - P3
Reporter: Antoine Girbal Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

old config is:
{
"setName" : "foo",
"ismaster" : false,
"secondary" : true,
"hosts" : [
"localhost:27018",
"localhost:27017"
],
"passives" : [
"localhost:27019"
],
"primary" : "localhost:27018",
"passive" : true,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}

made new config:
{
"_id" : "foo",
"version" : 5,
"members" : [

{ "_id" : 0, "host" : "dbhost1:27017" }

,

{ "_id" : 1, "host" : "dbhost2:27018" }

,

{ "_id" : 2, "host" : "dbhost3:27019" }

]
}

once called reconfig, got ok=1, and no error in logs.
rs.conf() shows the new config.
But db.isMaster() or db.serverStatus() still shows old config.
Eventually restarted master, then it showed the new config.
Still the non-restarted slave was still showing old config.

foo:SECONDARY> db.isMaster()
{
"setName" : "foo",
"ismaster" : false,
"secondary" : true,
"hosts" : [
"localhost:27018",
"localhost:27017"
],
"passives" : [
"localhost:27019"
],
"primary" : "localhost:27018",
"passive" : true,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}

Upon reconfig log showed:
Thu Feb 24 13:04:27 [conn411] replSet replSetReconfig config object parses ok, 3 members specified
Thu Feb 24 13:04:27 [conn411] replSet replSetReconfig [2]
Thu Feb 24 13:04:27 [conn411] replSet info saving a newer config version to local.system.replset
Thu Feb 24 13:04:27 [conn411] replSet info : additive change to configuration
Thu Feb 24 13:04:27 [conn411] replSet replSetReconfig new config saved locally
Thu Feb 24 13:04:27 [conn411] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo", version: 5, members: [

{ _id: 0, host: "dbhost1:27017" }

,

{ _id: 1, host: "dbhost2:27018" }

,

{ _id: 2, host: "dbhost3:27019" }

] } } reslen:53 107ms

Assuming that once reconfig is successful, all commands should show it.



 Comments   
Comment by Kristina Chodorow (Inactive) [ 28/Feb/11 ]

This shouldn't even be allowed.

Comment by auto [ 28/Feb/11 ]

Author:

{u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: don't allow changing from localhost to hostname SERVER-2622
https://github.com/mongodb/mongo/commit/7bf3c53a70eaa905ab3f5bdf7d76c17dfebed33f

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