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

Allow deterministic lockSessionID assignment for distlocks, so that after CSRS failover processes on the config primary can reacquire locks immediately.

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.3.5
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding 13 (04/22/16)

    Description

      In order to enable new config primaries to immediately gain access to the locks held by the old config primary, rather than waiting around for locks to expire, the lockSessionID must be specifiable and not always random so that the new primary knows what it is.

      Current signature:

      StatusWith<DistLockManager::ScopedDistLock> ReplSetDistLockManager::lock(
          OperationContext* txn,
          StringData name,
          StringData whyMessage,
          milliseconds waitFor,
          milliseconds lockTryInterval);
      

      Add new function:

      StatusWith<DistLockManager::ScopedDistLock> ReplSetDistLockManager::lockWithSessionID(
          OperationContext* txn,
          StringData name,
          StringData whyMessage,
          milliseconds waitFor,
          milliseconds lockTryInterval,
          OID lockSessionID);
      

      ReplSetDistLockManager::lock will generate a OID and call ReplSetDistLockManager::lockWithSessionID, which will contain all the current implementation with the modification of not generating the lockSessionID that it now receives and comparing the lockSessionID to the lock's session ID to check whether the lock can be overtaken on a match.

      Attachments

        Activity

          People

            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: