Operational Defect Database

BugZero found this defect 18 days ago.

MongoDB | 2660124

dropDatabase may complete without emitting an op entry when the node performing the operation gets restarted mid-request

Last update date:

5/2/2024

Affected products:

MongoDB Server

Affected releases:

6.0.0

7.0.0

8.0.0-rc0

7.3.0

8.1.0-rc0

Fixed releases:

No fixed releases provided.

Description:

Info

Consider the following sequence: A client requests a dropDatabase(dbName) to a sharded cluster The DDL request is served by the primary shard, until the point on which all the collections under dbName get removed from the local catalog; secondary nodes replicate the collection removals; Before reaching the stage on which the dropDatabase op entry is written onto the oplog, the primary shard receives a shutdown (for restart) signal, so that the DDL is interrupted; Upon restart, the newly spawned process is elected as the RS primary As part of the initialisation routine, the newly spawned process fills up its DatabaseHolder (the in-memory cache of existing database names, according to the collection names retrieved from the local catalog): due to step 2, dbName is no longer present; When the sharding DDL coordinator resumes the execution of dropDatabase(dbName), the absence of dbName from DatabaseHolder causes the function in charge of executing step 1 to early exit, skipping the instruction to generate the op entry about the completion of the DDL on the local node.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Backlog

Learn More

Search:

...