[SERVER-62602] Remove unnecessary durable catalog reads for multi-document transactions Created: 13/Jan/22  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-59444 Enable lock-free reads with multi-doc... Backlog
Related
Assigned Teams:
Storage Execution
Participants:

 Description   

With lock-free reads, we can gain a decent speedup by not reading from the durable catalog for every index that we use in a transaction.

This diff results in a green patch, and with some experimental results, speedups for some transactions workloads.

diff --git a/src/mongo/db/catalog/index_catalog_entry_impl.cpp b/src/mongo/db/catalog/index_catalog_entry_impl.cpp
index 94e09994b0c..c27d8cda7f9 100644
--- a/src/mongo/db/catalog/index_catalog_entry_impl.cpp
+++ b/src/mongo/db/catalog/index_catalog_entry_impl.cpp
@@ -120,18 +120,6 @@ void IndexCatalogEntryImpl::init(std::unique_ptr<IndexAccessMethod> accessMethod
 
 bool IndexCatalogEntryImpl::isReady(OperationContext* opCtx,
                                     const CollectionPtr& collection) const {
-    // For multi-document transactions, we can open a snapshot prior to checking the
-    // minimumSnapshotVersion on a collection.  This means we are unprotected from reading
-    // out-of-sync index catalog entries.  To fix this, we uassert if we detect that the
-    // in-memory catalog is out-of-sync with the on-disk catalog.
-    if (opCtx->inMultiDocumentTransaction()) {
-        if (!isPresentInMySnapshot(opCtx) || isReadyInMySnapshot(opCtx) != _isReady) {
-            uasserted(ErrorCodes::SnapshotUnavailable,
-                      str::stream() << "Unable to read from a snapshot due to pending collection"
-                                       " catalog changes; please retry the operation.");
-        }
-    }
-


Generated at Thu Feb 08 05:55:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.