[SERVER-29876] Two Phase Drops: dropDatabase should always wait for pending collection drops to complete Created: 27/Jun/17  Updated: 30/Oct/23  Resolved: 29/Jun/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-31436 dropDatabase must check `ReplicationC... Closed
is related to SERVER-29277 Two Phase Drops: implement dropDataba... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2017-07-31
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 29/Jun/17 ]

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

Comment by Githook User [ 29/Jun/17 ]

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

Comment by Githook User [ 28/Jun/17 ]

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

Comment by Githook User [ 28/Jun/17 ]

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

Comment by Githook User [ 28/Jun/17 ]

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

Comment by Githook User [ 28/Jun/17 ]

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

Generated at Thu Feb 08 04:22:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.