[SERVER-2484] Cannot set "initialSync" replica set config Created: 05/Feb/11  Updated: 12/Jul/16  Resolved: 06/Feb/11

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 1.7.5
Fix Version/s: 1.7.6

Type: Bug Priority: Major - P3
Reporter: David Mytton 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   

Attempting to reconfigure a replica set with the initialSync config options doesn't work.

david@rs1a ~: ./console
MongoDB shell version: 1.7.5
connecting to: localhost:27018/test
set1:PRIMARY> cfg = rs.conf()
{
"_id" : "set1",
"version" : 8,
"members" : [

{ "_id" : 0, "host" : "rs1a:27018" }

,

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

,

{ "_id" : 3, "host" : "rs1arbiter:27018", "arbiterOnly" : true }

,

{ "_id" : 4, "host" : "rs1c:27018", "priority" : 0, "hidden" : true }

,

{ "_id" : 5, "host" : "rs1d:27018", "priority" : 0, "slaveDelay" : 7200, "hidden" : true }

]
}
set1:PRIMARY> cfg.members[0].initialSync =

{state: 2} { "state" : 2 }

set1:PRIMARY> cfg.members[1].initialSync =

{state: 2} { "state" : 2 }

set1:PRIMARY> cfg.members[3].initialSync =

{state: 2} { "state" : 2 }

set1:PRIMARY> cfg.members[4].initialSync =

{state: 2} { "state" : 2 }

set1:PRIMARY> cfg
{
"_id" : "set1",
"version" : 8,
"members" : [
{
"_id" : 0,
"host" : "rs1a:27018",
"initialSync" :

{ "state" : 2 }

},
{
"_id" : 1,
"host" : "rs1b:27018",
"initialSync" :

{ "state" : 2 }

},

{ "_id" : 3, "host" : "rs1arbiter:27018", "arbiterOnly" : true }

,
{
"_id" : 4,
"host" : "rs1c:27018",
"priority" : 0,
"hidden" : true,
"initialSync" :

{ "state" : 2 }

},
{
"_id" : 5,
"host" : "rs1d:27018",
"priority" : 0,
"slaveDelay" : 7200,
"hidden" : true,
"initialSync" :

{ "state" : 2 }

}
]
}
set1:PRIMARY> rs.reconfig(cfg)
Sat Feb 5 07:56:32 DBClientCursor::init call() failed
Sat Feb 5 07:56:32 query failed : admin.$cmd { replSetReconfig: { _id: "set1", version: 9, members: [ { _id: 0, host: "rs1a:27018", initialSync:

{ state: 2.0 }

}, { _id: 1, host: "rs1b:27018", initialSync:

{ state: 2.0 }

},

{ _id: 3, host: "rs1arbiter:27018", arbiterOnly: true }

, { _id: 4, host: "rs1c:27018", priority: 0.0, hidden: true, initialSync:

{ state: 2.0 }

}, { _id: 5, host: "rs1d:27018", priority: 0.0, slaveDelay: 7200, hidden: true, initialSync:

{ state: 2.0 }

} ] } } to: localhost:27018
shell got exception during reconfig: Error: error doing query: failed
in some circumstances, the primary steps down and closes connections on a reconfig
null
Sat Feb 5 07:56:32 trying reconnect to localhost:27018
Sat Feb 5 07:56:32 reconnect localhost:27018 ok
set1:SECONDARY> rs.conf()
{
"_id" : "set1",
"version" : 9,
"members" : [

{ "_id" : 0, "host" : "rs1a:27018" }

,

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

,

{ "_id" : 3, "host" : "rs1arbiter:27018", "arbiterOnly" : true }

,

{ "_id" : 4, "host" : "rs1c:27018", "priority" : 0, "hidden" : true }

,

{ "_id" : 5, "host" : "rs1d:27018", "priority" : 0, "slaveDelay" : 7200, "hidden" : true }

]
}



 Comments   
Comment by auto [ 06/Feb/11 ]

Author:

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

Message: fix initialSync on reconfig SERVER-2484
https://github.com/mongodb/mongo/commit/cfd9c0e758a61f1b66de99a54fa965c2665bd845

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

Yes, the "syncing to:" line indicates which server it's copying data from.

Comment by David Mytton [ 05/Feb/11 ]

That message was from the log on rs1d. rs1a was (and still is) the master. rs1c is a slave. Can't current resync rs1d because of CS-303.

set1:PRIMARY> rs.status()
{
"set" : "set1",
"date" : ISODate("2011-02-05T18:10:15Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "rs1a:27018",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"optime" :

{ "t" : 1296929415000, "i" : 177 }

,
"optimeDate" : ISODate("2011-02-05T18:10:15Z"),
"self" : true
},
{
"_id" : 1,
"name" : "rs1b:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 36821,
"optime" :

{ "t" : 1296929415000, "i" : 164 }

,
"optimeDate" : ISODate("2011-02-05T18:10:15Z"),
"lastHeartbeat" : ISODate("2011-02-05T18:10:15Z")
},
{
"_id" : 3,
"name" : "rs1arbiter:27018",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 36821,
"optime" :

{ "t" : 0, "i" : 0 }

,
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2011-02-05T18:10:14Z")
},
{
"_id" : 4,
"name" : "rs1c:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 36821,
"optime" :

{ "t" : 1296929411000, "i" : 317 }

,
"optimeDate" : ISODate("2011-02-05T18:10:11Z"),
"lastHeartbeat" : ISODate("2011-02-05T18:10:13Z")
},
{
"_id" : 5,
"name" : "rs1d:27018",
"health" : 0,
"state" : 3,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" :

{ "t" : 0, "i" : 0 }

,
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2011-02-05T16:01:35Z"),
"errmsg" : "socket exception"
}
],
"ok" : 1
}

Comment by Alvin Richards (Inactive) [ 05/Feb/11 ]

At the point you got that message, which member was the primary? From the config, r21c was hidden

{
"_id" : 4,
"host" : "rs1c:27018",
"priority" : 0,
"hidden" : true
},

Comment by David Mytton [ 05/Feb/11 ]

I'm resyncing a slave (rs1d) and it looks like it might be syncing from slave as per the reconfig. Is that what "Sat Feb 5 08:22:23 [replica set sync] replSet syncing to: rs1c:27018" means?

Sat Feb 5 08:22:12 [FileAllocator] done allocating datafile /mongodbdata/local.75, size: 2047MB, took 5.773 secs
Sat Feb 5 08:22:12 [FileAllocator] allocating new datafile /mongodbdata/local.76, filling with zeroes...
Sat Feb 5 08:22:18 [FileAllocator] done allocating datafile /mongodbdata/local.76, size: 2047MB, took 5.914 secs
Sat Feb 5 08:22:23 [replica set sync] ******
Sat Feb 5 08:22:23 [replica set sync] replSet initial sync pending
Sat Feb 5 08:22:23 [replica set sync] replSet syncing to: rs1c:27018
Sat Feb 5 08:22:23 [conn7] query admin.$cmd ntoreturn:1 command:

{ listDatabases: 1 }

reslen:192 426523ms
Sat Feb 5 08:22:23 [replica set sync] building new index on

{ _id: 1 }

for local.me
Sat Feb 5 08:22:23 [replica set sync] done for 0 records 0.048secs
Sat Feb 5 08:22:23 [replica set sync] replSet initial sync drop all databases
Sat Feb 5 08:22:23 [replica set sync] dropAllDatabasesExceptLocal 1
Sat Feb 5 08:22:23 [replica set sync] replSet initial sync clone all databases
Sat Feb 5 08:22:23 [replica set sync] replSet initial sync cloning db: postbacks
Sat Feb 5 08:22:23 [FileAllocator] allocating new datafile /mongodbdata/postbacks.ns, filling with zeroes...

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