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

Remove the setSharedLocksShouldTwoPhaseLock property from the Locker

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • 1

      The sharedLocksShouldTwoPhaseLock property on the Locker is set when a shard receives a beginTransaction request and it dictates that the locker should delay S and IS lock acquisitions until the end of a multi-statement transaction.

      However, in multi-statement transactions we must and already do upgrade IS requests to IX. This must be done because without it, we could end up with lock conversions if a read is followed by a write in a transaction.

      Running a patch build it appears that this property is never reached and also in general it would be a potential deadlock if it were.

      This ticket is to remove this property entirely. Also as part of this work we should consider removing the isMultiDocumentTransaction() state from the OperationContext and instead relying on the TransactionResources. Having the isMultiDocumentTransaction() property on the OperationContext is error prone since it requires that it carefully be kept in sync with the transaction stashing and unstashing.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: