From fbdef2ccc53e0fcc9afb570063633d992b2aae42 Mon Sep 17 00:00:00 2001 From: Ramon Fernandez Date: Fri, 9 Feb 2018 13:54:18 -0500 Subject: SERVER-33238 Revert the change that kept ftdc from stalling with no tickets This reverts commit 4fa890fa8b6ba3b438213efcfab07b588fd58e63. --- src/mongo/db/concurrency/lock_state.cpp | 2 +- src/mongo/db/concurrency/locker.h | 13 ------------- src/mongo/db/ftdc/collector.cpp | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index c1d02193129..bf48ec3ba51 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -311,7 +311,7 @@ LockResult LockerImpl::_lockGlobalBegin(LockMode mode, Milliseconds dassert(isLocked() == (_modeForTicket != MODE_NONE)); if (_modeForTicket == MODE_NONE) { const bool reader = isSharedLockMode(mode); - auto holder = shouldAcquireTicket() ? ticketHolders[mode] : nullptr; + auto holder = ticketHolders[mode]; if (holder) { _clientState.store(reader ? kQueuedReader : kQueuedWriter); if (timeout == Milliseconds::max()) { diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h index 10466e143b4..37af569124f 100644 --- a/src/mongo/db/concurrency/locker.h +++ b/src/mongo/db/concurrency/locker.h @@ -334,24 +334,11 @@ public: return _shouldConflictWithSecondaryBatchApplication; } - /** - * If set to false, this opts out of the ticket mechanism. This should be used sparingly - * for special purpose threads, such as FTDC. - */ - void setShouldAcquireTicket(bool newValue) { - _shouldAcquireTicket = newValue; - } - bool shouldAcquireTicket() const { - return _shouldAcquireTicket; - } - - protected: Locker() {} private: bool _shouldConflictWithSecondaryBatchApplication = true; - bool _shouldAcquireTicket = true; }; } // namespace mongo diff --git a/src/mongo/db/ftdc/collector.cpp b/src/mongo/db/ftdc/collector.cpp index 7c35fb12bb6..611f12dff5a 100644 --- a/src/mongo/db/ftdc/collector.cpp +++ b/src/mongo/db/ftdc/collector.cpp @@ -67,7 +67,6 @@ std::tuple FTDCCollectorCollection::collect(Client* client) { // batches that are taking a long time. auto txn = client->makeOperationContext(); txn->lockState()->setShouldConflictWithSecondaryBatchApplication(false); - txn->lockState()->setShouldAcquireTicket(false); for (auto& collector : _collectors) { BSONObjBuilder subObjBuilder(builder.subobjStart(collector->name())); -- cgit v1.2.1