[SERVER-7652] Initial sync criteria needs to check minValid, not the oplog Created: 13/Nov/12  Updated: 03/May/17  Resolved: 05/Dec/12

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.2.2
Fix Version/s: 2.3.2

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

Issue Links:
Depends
depends on DOCS-961 Update/create documentation for "prim... Closed
Related
related to SERVER-8139 New replication dep. on minvalid coll... Closed
Operating System: ALL
Participants:

 Description   

The criteria for initiating an initial sync currently checks to see if no ops are in the oplog. This worked fine until we started adding ops as part of initial sync in order to fix index unique constraint violations.
If you were to crash after cloning dbs but before generating indexes, it would be possible to restart the node and have it go straight into SECONDARY without completing the index builds.

Instead, the criteria should be whether the node has a minValid set. minValid is not set until the very end of initial sync after everything has successfully completed.
As a sanity check, the node should fassert if it finds that minValid exists but there are no ops in the oplog, as this situation should be impossible.



 Comments   
Comment by Eric Milkie [ 16/Jan/13 ]

This was reverted from 2.2.3.
It was left in 2.3.2 but will be superceded by SERVER-8139

Comment by auto [ 10/Jan/13 ]

Author:

{u'date': u'2013-01-10T21:26:16Z', u'email': u'kristina@10gen.com', u'name': u'Kristina'}

Message: Revert "SERVER-7652 Use minvalid to determine if initial sync is needed"

This reverts commit 832a4c0ccf4fb4135429487477ba93dd9370b5e0.
Branch: v2.2
https://github.com/mongodb/mongo/commit/511cbba4d22ac7f2118608927144fe243a76bd16

Comment by Ian Daniel [ 08/Jan/13 ]

Documentation ticket: DOCS-961

Comment by auto [ 08/Jan/13 ]

Author:

{u'date': u'2012-11-30T16:37:59Z', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: SERVER-7652 Use minvalid to determine if initial sync is needed
Branch: v2.2
https://github.com/mongodb/mongo/commit/832a4c0ccf4fb4135429487477ba93dd9370b5e0

Comment by auto [ 05/Dec/12 ]

Author:

{u'date': u'2012-11-30T16:37:59Z', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

Message: SERVER-7652 Use minvalid to determine if initial sync is needed
Branch: master
https://github.com/mongodb/mongo/commit/3df3cf0feb9d7f2482be11cfd805f9647e1a6f44

Comment by Kristina Chodorow (Inactive) [ 15/Nov/12 ]

Also: add a note in comments about what minvalid's function is.

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