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

LockerImpl::wasGlobalLockTaken() always returns true

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.4, 4.3.3
    • Affects Version/s: None
    • Component/s: Replication, Storage
    • None
    • Fully Compatible
    • ALL
    • v4.2
    • 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()); +} +
    • Repl 2020-01-27
    • 14

      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).

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: