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

LockerImpl::wasGlobalLockTaken() always returns true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.3
    • Component/s: Replication, Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Steps To Reproduce:
      Hide

      diff --git a/src/mongo/db/concurrency/d_concurrency_test.cpp b/src/mongo/db/concurrency/d_concurrency_test.cpp
      index c19883a2b1..6562b1667f 100644
      --- a/src/mongo/db/concurrency/d_concurrency_test.cpp
      +++ b/src/mongo/db/concurrency/d_concurrency_test.cpp
      @@ -485,6 +485,12 @@ TEST_F(DConcurrencyTestFixture, GlobalLockXSetsGlobalWriteLockedOnOperationConte
           ASSERT_TRUE(opCtx->lockState()->wasGlobalLockTakenForWrite());
       }
       
      +TEST_F(DConcurrencyTestFixture, WasGlobalLockTaken) {
      +    auto clients = makeKClientsWithLockers(1);
      +    auto opCtx = clients[0].second.get();
      +    ASSERT_FALSE(opCtx->lockState()->wasGlobalLockTaken());
      +}
      +
      

      Show
      diff --git a/src/mongo/db/concurrency/d_concurrency_test.cpp b/src/mongo/db/concurrency/d_concurrency_test.cpp index c19883a2b1..6562b1667f 100644 --- a/src/mongo/db/concurrency/d_concurrency_test.cpp +++ b/src/mongo/db/concurrency/d_concurrency_test.cpp @@ -485,6 +485,12 @@ TEST_F(DConcurrencyTestFixture, GlobalLockXSetsGlobalWriteLockedOnOperationConte ASSERT_TRUE(opCtx->lockState()->wasGlobalLockTakenForWrite()); } +TEST_F(DConcurrencyTestFixture, WasGlobalLockTaken) { + auto clients = makeKClientsWithLockers(1); + auto opCtx = clients[0].second.get(); + ASSERT_FALSE(opCtx->lockState()->wasGlobalLockTaken()); +} +
    • Sprint:
      Repl 2020-01-27
    • Linked BF Score:
      14

      Description

      The only usage is here, for deciding whether to take a lock to collect storage stats. The intention was that commands that do not take locks should not take a lock for logging. Although that usage has a deadline in order to avoid deadlock, the PBWM acquisition does not respect the deadlock (SERVER-45007).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: