Operational Defect Database

BugZero found this defect 2435 days ago.

MongoDB | 398560

[SERVER-29874] Two Phase Drops: dropDatabase does not work with applyOps

Last update date:

10/30/2023

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

3.5.10

Description:

Info

Since SERVER-29277, the dropDatabase waits for all collection drops to complete before removing the entry for the database from the catalog. To do this, the free function mongo::dropDatabase() needs to call either ReplicationCoordinator::awaitReplicationOfLastOpForClient() or ReplicationCoordinator::awaitReplication(). However, these functions fail when dropDatabase() is called from within an applyOps operation because applyOps executes all its given operations while holding the global lock. To reproduce: db.adminCommand({applyOps: [{op: 'c', ns: 'test.$cmd', o: {create: 't'}}, {op: 'c', ns: 'test.$cmd', o: {drop: 't'}}, {op: 'c', ns: 'test.$cmd', o: {dropDatabase: 1}}]})

Top User Comments

xgen-internal-githook commented on Thu, 29 Jun 2017 19:12:28 +0000: Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'} Message: SERVER-29874 dropDatabase() releases locks when awaiting replication This allows dropDatabase() to work with applyOps when we have to wait for collection drops to replicate Branch: master https://github.com/mongodb/mongo/commit/57e3704f443df1fb071e0af81421ce2999fad767

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:

...