Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62602

Remove unnecessary durable catalog reads for multi-document transactions

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Storage Execution

    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.");
      -        }
      -    }
      -
      

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: