-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.2.0
-
Component/s: Replication, Storage
-
None
-
Fully Compatible
-
ALL
-
v4.2
-
Repl 2019-09-09, Repl 2019-09-23, Repl 2019-10-07, Repl 2019-10-21, Repl 2019-11-04, Repl 2019-11-18
-
12
The MongoDB catalog is currently compromised of two layers:
- An in-memory layer that represents "now"
- A durable layer which is transparently (to the storage engine) backed in the same datastore as all of the other data.
A single read of the catalog can be serviced by both layers and the durable layer is typically keyed on the collection namespace. Thus allowing changes to the in-memory version while holding a transaction/snapshot open on the durable layer requires concurrency control to prevent wires getting crossed.
The proposed contract for catalog reads safe:
- Reading with a timestamped (storage) transaction is always safe.
- Reading without a timestamped transaction requires either:
- Acquiring locks on all relevant collections prior to acquiring a snapshot for a catalog read.
- Computing/Setting a "catalog conflicting timestamp". The snapshot acquired must include all writes up to this time. It's permissible for the snapshot to include additional writes at a later timestamp.
In cases where a read timestamp is not specified, the "catalog conflicting timestamp" must be substituted for comparison against "minimum visible timestamps" (1, 2 and 3).
This "catalog conflicting timestamp" mechanism can be removed when a versioned catalog backed by the durable catalog is in place.
A sample, incomplete patch is attached.
- is depended on by
-
SERVER-40620 Return or log error if an index key is present but the document is not
- Closed
- is related to
-
SERVER-45421 Fix transactions_block_ddl.js to use write concern "majority" for commands run as part of setup phase.
- Closed
- related to
-
SERVER-40352 Transactions that perform untimestamped reads do not check min visible snapshot for collection
- Closed
-
SERVER-42956 ReadyIndexesIterator::_advance() does not perform isReady() check
- Closed
-
SERVER-42497 Detect/log unintentional untimestamped writes to catalog table
- Closed