When acquiring a collection, we establish a capped snapshot if the collection requires it. When doing so, we simply look up into the collection catalog. If such a collection is concurrently being created, in the version of the collection catalog we're using it may have been added to CollectionCatalog::_pendingCommitNamespaces as a part of the pre-commit hooks. However it's possible that we haven't yet executed the commit handlers which come after committing the storage transaction. This would mean that we haven't registered the collection with the collection catalog yet; thus the aforementioned lookup in the collection catalog would not find the collection, and we would (incorrectly) not establish a capped snapshot. Then later in the collection acquisition logic we establish a consistent collection which opens the collection because it is in CollectionCatalog::_pendingCommitNamespaces. Therefore the end state of this sequence of events is that we have performed a collection acquisition on a collection which uses capped snapshots, without performing the required capped snapshot establishment.
Collection acquisition establishing capped snapshot can miss collection concurrently being created
- Assignee:
- Jordi Olivares Provencio
- Reporter:
- Gregory Noma
- Votes:
-
0 Vote for this issue
- Watchers:
-
12 Start watching this issue
- Created:
- Updated:
- Resolved: