From 37505c95cf5f7ededc83fc6a855a46653ac39383 Mon Sep 17 00:00:00 2001 From: Kelsey Schubert Date: Mon, 12 Feb 2018 17:02:10 -0500 Subject: Revert "SERVER-32875 Don't stall ftdc due to running out of tickets" This reverts commit da5520555faef9a2ba9b6c9ec80539ae95ad88a5. --- 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 f4485ddd3b4..49d4031506d 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -307,7 +307,7 @@ LockResult LockerImpl::_lockGlobalBegin(LockMode mode, Date_t deadl 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 (deadline == Date_t::max()) { diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h index dba13215eb1..a8690ce2d37 100644 --- a/src/mongo/db/concurrency/locker.h +++ b/src/mongo/db/concurrency/locker.h @@ -329,24 +329,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 c1e0c47158d..78e4f0de60a 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 opCtx = client->makeOperationContext(); opCtx->lockState()->setShouldConflictWithSecondaryBatchApplication(false); - opCtx->lockState()->setShouldAcquireTicket(false); for (auto& collector : _collectors) { BSONObjBuilder subObjBuilder(builder.subobjStart(collector->name())); -- cgit v1.2.1