[SERVER-13620] Replicated data definition commands will fail on secondaries during background index build Created: 16/Apr/14  Updated: 11/Jul/16  Resolved: 21/Apr/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.6.1, 2.7.0

Type: Bug Priority: Critical - P2
Reporter: Eric Milkie Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Backport Completed:
Steps To Reproduce:

e.g. in indexbg_drop.js, the drop doesn't actually take effect on the secondary. The drop command fails but we fail to notice the problem due to SERVER-13601

Participants:

 Description   
Issue Status as of April 22, 2014

ISSUE SUMMARY
Data definition commands, like creating or dropping databases, collections or indexes, will fail on a secondary if that secondary has a background index build in progress on the same collection.

USER IMPACT
The failure is silent and can lead to inconsistency between replica set members.

WORKAROUNDS
Building the index in the foreground avoids the issue. If users rely on background index builds, they should confirm that all index builds have completed before running any data definition commands.

RESOLUTION
The secondaries wait to apply the data definition commands if a background index build is in progress.

AFFECTED VERSIONS
Version 2.6.0 is affected by this bug.

PATCHES
The patch is included in the 2.6.1 production release.



 Comments   
Comment by Githook User [ 22/Apr/14 ]

Author:

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

Message: SERVER-13620 fix assert codes to be the same as in 2.6
Branch: master
https://github.com/mongodb/mongo/commit/3a613a84a4f9a22a70c387e67305dd1b486bae68

Comment by Githook User [ 21/Apr/14 ]

Author:

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

Message: SERVER-13620 update fassert code
Branch: v2.6
https://github.com/mongodb/mongo/commit/14e0ba91a9897018c6a0232eb25ab96f1c451a4f

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 When applying operations from the oplog, wait for background operations to complete as necessary.

(cherry picked from commit 070d58c191ab626605bcdd45db2f7990faa46399)

Conflicts:
src/mongo/base/error_codes.err
Branch: master
https://github.com/mongodb/mongo/commit/53cfe8bd7ce31f0e67efcb0fa41a019f110f2a22

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 Refactor background.h/cpp; add awaitNoBgOp methods.

(cherry picked from commit 9ad97ac9fd08cf56d4e6c4bdb5c1b10085b9040c)
Branch: master
https://github.com/mongodb/mongo/commit/001b2c1ee301f814c4b9128b2f0ef1ee1354a4f1

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 Make indexbg_drop.js expose the bug.

(cherry picked from commit d4b1e9e2e5097ff777b69543183088fa1fbb0129)
Branch: master
https://github.com/mongodb/mongo/commit/9be380c23afdad4ab7c4b09762f2f3d95caf674f

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 When applying operations from the oplog, wait for background operations to complete as necessary.
Branch: v2.6
https://github.com/mongodb/mongo/commit/070d58c191ab626605bcdd45db2f7990faa46399

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 Refactor background.h/cpp; add awaitNoBgOp methods.
Branch: v2.6
https://github.com/mongodb/mongo/commit/9ad97ac9fd08cf56d4e6c4bdb5c1b10085b9040c

Comment by Githook User [ 21/Apr/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13620 Make indexbg_drop.js expose the bug.
Branch: v2.6
https://github.com/mongodb/mongo/commit/d4b1e9e2e5097ff777b69543183088fa1fbb0129

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