Operational Defect Database

BugZero found this defect 2432 days ago.

MongoDB | 398632

[SERVER-29876] Two Phase Drops: dropDatabase should always wait for pending collection drops to complete

Last update date:

10/30/2023

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

3.5.10

Description:

Info

SERVER-29277 changed the behavior of dropDatabase such that it will drop all collections and wait for the drops to replicate before returning. However, if the only collections in the database at the time of the dropDatabase request are already in the drop-pending state (ie. in the <db>.system.drop.* namespace), dropDatabase() will erroneously fail to detect any collections it needs to wait for and removes the database immediately. To fix this, dropDatabase() needs to detect any drop-pending collections and parse the most recent optime of these drop-pending collections that it will call ReplicationCoordinator::awaitReplication() with. This only applies to the case when dropDatabase() doesn't initiate any collection drops.

Top User Comments

xgen-internal-githook commented on Thu, 29 Jun 2017 15:25:27 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 dropDatabase() waits for pending collection drops to complete Branch: master https://github.com/mongodb/mongo/commit/560b3f562832664c1cb09cdbf3a257493bad6ba8 xgen-internal-githook commented on Thu, 29 Jun 2017 14:18:10 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 ReplicationCoordinatorMock::AwaitReplicationReturnValueFunction accepts optime Branch: master https://github.com/mongodb/mongo/commit/b9be45f58636244600b992930abe6791c115cfa0 xgen-internal-githook commented on Wed, 28 Jun 2017 20:52:54 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 change tool_replset.js to drop collection instead of database Branch: master https://github.com/mongodb/mongo/commit/c14f4e64c98b70b118bc0f2ee9c575f189de0038 xgen-internal-githook commented on Wed, 28 Jun 2017 20:21:50 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 change oplog_all_ops.js to drop collection instead of the database Branch: master https://github.com/mongodb/mongo/commit/027b1151c78288f31e29f4b59dc41c9ed935fa79 xgen-internal-githook commented on Wed, 28 Jun 2017 19:17:10 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 stop using applyOps to run dropDatabase in user_defined_roles_on_secondaries.js Branch: master https://github.com/mongodb/mongo/commit/a1b8f8c9b2a6f3b115f517bd37e9a841e87c9eeb xgen-internal-githook commented on Wed, 28 Jun 2017 16:41:15 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29876 read_committed_with_catalog_changes.js drops collection during the preparation phase instead of during the performOp phase so that dropDatabase does not block Branch: master https://github.com/mongodb/mongo/commit/58518c5174a1854060428e183ac6049c64ac0517

Additional Resources / Links

Share:

BugZero Risk Score

Coming soon

Status

Closed

Have you been affected by this bug?

cost-cta-background

Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.

Discussion

Login to read and write comments.

Have you ever...

had your data corrupted from a

VMware

bug?

Search:

...