Operational Defect Database

BugZero found this defect 79 days ago.

MongoDB | 2595942

Race in oplog acquisition at startup

Last update date:

3/11/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

During ReplicationCoordinatorImpl startup, we initialize the LocalOplogInfo oplog collection by calling acquireOplogForLogging https://github.com/mongodb/mongo/blame/b70be78ecfe773a1c9b5685b4af9cd25ea214eb5/src/mongo/db/repl/oplog.cpp#L2548 This acquires an IX lock on the oplog collection, and oplogInfo itself is not protected at all. Thus a simultaneous call which reads the oplogInfo pointer with only an IS global lock can cause a data race. Possibly we should acquire global X here, as the catalog code does when it uses the similar establishOplogForLogging().

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Open

Learn More

Search:

...