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

RecordStore RecordId initialization can deadlock transactions with cache eviction

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.2.0, 5.1.2, 5.0.6
    • 5.3.0, 5.2.1, 5.0.7
    • None
    • None
    • Fully Compatible
    • ALL
    • v5.2, v5.0, v4.4
    • Execution Team 2022-02-07, Execution Team 2022-02-21
    • 155

    Description

      There is a bug with our RecordId initialization that is more generally described by SERVER-61116. As a consequence, very large multi-document transactions that consume most of cache can deadlock. In practice, this has to be the first transaction to write to a given collection.

      We create a new WT_SESSION to call largest_key() to lazily initialize the highest RecordId for a collection (as of SERVER-58409). We can do this while holding hostage another session that is pinning a large amount of data in the cache. If this large transaction is pinning enough data, then the largest_key() call can block, but the session pinning that content cannot be rolled-back because it is held by the same thread.

      We should use an "operation_timeout_ms" here, as we did in SERVER-61097. This will cause the operation to receive a WT_ROLLBACK after a period of time, which we should throw back to the parent operation to retry.

      Attachments

        Issue Links

          Activity

            People

              louis.williams@mongodb.com Louis Williams
              louis.williams@mongodb.com Louis Williams
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: