[SERVER-4750] Secondary syncs to another secondary that has slaveDelay > 0 Created: 24/Jan/12  Updated: 04/Feb/15  Resolved: 06/Mar/12

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 1.8.4, 2.0.2
Fix Version/s: 2.0.6, 2.1.1

Type: Bug Priority: Major - P3
Reporter: Ansgar Hofmann Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-5706 If only slaveDelay'd nodes are availa... Closed
Related
related to SERVER-4439 Replica set members shouldn't sync fr... Closed
related to SERVER-5208 Replica set periodic reevaluation of ... Closed
related to DOCS-154 Add section to replication-internals ... Closed
is related to SERVER-6457 Secondary syncing to hidden secondary Closed
Operating System: ALL
Participants:

 Description   

I have this replset:

{
"_id" : "myReplSet",
"version" : 9,
"members" : [

{ "_id" : 0, "host" : "a1.serv:27017" }

,

{ "_id" : 1, "host" : "s1.serv:27017", "priority" : 0, "slaveDelay" : 10800, "hidden" : true }

,

{ "_id" : 2, "host" : "a2.serv:27017" }

]
}
a1.serv ist primary atm.
when a2.serv starts the log says:

Tue Jan 24 10:59:40 [rsStart] replSet STARTUP2
Tue Jan 24 10:59:40 [rsSync] replSet SECONDARY
Tue Jan 24 10:59:42 [rsHealthPoll] replSet member a1.serv:27017 is up
Tue Jan 24 10:59:42 [rsHealthPoll] replSet member a1.serv:27017 is now in state PRIMARY
Tue Jan 24 10:59:42 [rsHealthPoll] replSet member s1.serv:27017 is up
Tue Jan 24 10:59:42 [rsHealthPoll] replSet member s1.serv:27017 is now in state SECONDARY
Tue Jan 24 10:59:46 [rsSync] replSet syncing to: s1.serv:27017

The only solution right now seems to remove slaveDelay for s1.serv.

How it should be: if a secondary in a replset searches for a peer to sync it should exclude peers that have a slaveDelay higher than itself.



 Comments   
Comment by auto [ 10/May/12 ]

Author:

{u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-5706 if only slaveDelay'd nodes are available, use them
SERVER-4750 prevent syncing to secondaries with a slavedelay greater than yourself

Conflicts:

db/repl/rs_initialsync.cpp
jstests/replsets/slavedelay3.js
Branch: v2.0
https://github.com/mongodb/mongo/commit/1aaac5eb0dc31c80f82080c9b3e75b49409b74cd

Comment by Andy Schwerin [ 25/Apr/12 ]

For 2.0.6, I think.

Comment by Scott Hernandez (Inactive) [ 25/Apr/12 ]

Yep, added a new issue to address this in the future : SERVER-5706

Comment by Andy Schwerin [ 25/Apr/12 ]

Before backporting, I'd like to know that this won't prevent syncing of secondaries that can only communicate with slave-delayed secondaries.

Comment by Sam Kleinman (Inactive) [ 08/Mar/12 ]

Marking documentation done after creating a separate docs ticket to be addressed in the near future.

Comment by auto [ 07/Mar/12 ]

Author:

{u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-4750 ensure member 0 is always elected primary, for test stability
Branch: master
https://github.com/mongodb/mongo/commit/eceb7584894362f09ba8ad5cbbc7a7a28fca35fb

Comment by auto [ 06/Mar/12 ]

Author:

{u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-4750 make unit test more reliable
Branch: master
https://github.com/mongodb/mongo/commit/28b3a0a48a9d6a6d76a723ee19b404512d18998d

Comment by auto [ 06/Mar/12 ]

Author:

{u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-4750: prevent syncing to secondaries with a slavedelay greater than yourself

After SERVER-5208, we can rework the logic here so that if a slavedelay'd node
is still ahead of us, we can use it for a little while and then once we're caught
up we'll reevaluate the cluster for better nodes to sync from.
Branch: master
https://github.com/mongodb/mongo/commit/e4f3f956888da028bb13a469f99941537f35f272

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