diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-04 13:50:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 13:50:41 +0100 |
commit | f0b3e4bffc42137d9a3706089fd06b4e37517675 (patch) | |
tree | 10091557db63098df48cb273ae44d03e4d713463 /storage | |
parent | 299f3ecaa104f02547ebb1ca886d0576bae3b3ff (diff) | |
parent | b6f3add041cce8acbc81e1636cd73452a78204d2 (diff) |
Merge pull request #15878 from vespa-engine/balder/process-queue-when-closed
- Do not stop persitence thread until it has been interrupted.
Diffstat (limited to 'storage')
4 files changed, 5 insertions, 24 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandler.h b/storage/src/vespa/storage/persistence/filestorage/filestorhandler.h index f6353f69c65..6171b3bd23d 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandler.h +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandler.h @@ -104,9 +104,8 @@ public: virtual void setDiskState(DiskState state) = 0; virtual DiskState getDiskState() const = 0; - /** Check whether it is enabled or not. */ - bool enabled() { return (getDiskState() == AVAILABLE); } - bool closed() { return (getDiskState() == CLOSED); } + /** Check if it has been closed. */ + bool closed() const { return (getDiskState() == CLOSED); } /** Closes all disk threads. */ virtual void close() = 0; @@ -189,11 +188,6 @@ public: RemapInfo& target1, RemapInfo& target2) = 0; - struct DeactivateCallback { - virtual ~DeactivateCallback() {} - virtual void handleDeactivate() = 0; - }; - /** * Fail all operations towards a single bucket currently queued to the * given thread with the given error code. @@ -222,11 +216,6 @@ public: */ virtual bool isMerging(const document::Bucket& bucket) const = 0; - /** - * @return Returns the number of active merges on the node. - */ - virtual uint32_t getNumActiveMerges() const = 0; - /** Removes the merge status for the given bucket. */ virtual void clearMergeStatus(const document::Bucket&) = 0; virtual void clearMergeStatus(const document::Bucket&, const api::ReturnCode&) = 0; diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index 53418172321..6a310f69787 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -104,13 +104,6 @@ FileStorHandlerImpl::isMerging(const document::Bucket& bucket) const return (_mergeStates.find(bucket) != _mergeStates.end()); } -uint32_t -FileStorHandlerImpl::getNumActiveMerges() const -{ - std::lock_guard mlock(_mergeStatesLock); - return _mergeStates.size(); -} - void FileStorHandlerImpl::clearMergeStatus(const document::Bucket& bucket) { @@ -867,7 +860,7 @@ FileStorHandlerImpl::Stripe::getNextMessage(vespalib::duration timeout) // if none can be found and then exiting if the same is the case on the // second attempt. This is key to allowing the run loop to register // ticks at regular intervals while not busy-waiting. - for (int attempt = 0; (attempt < 2) && ! _owner.isClosed() && !_owner.isPaused(); ++attempt) { + for (int attempt = 0; (attempt < 2) && !_owner.isPaused(); ++attempt) { PriorityIdx& idx(bmi::get<1>(*_queue)); PriorityIdx::iterator iter(idx.begin()), end(idx.end()); @@ -887,7 +880,7 @@ FileStorHandlerImpl::Stripe::getNextMessage(vespalib::duration timeout) FileStorHandler::LockedMessage FileStorHandlerImpl::Stripe::get_next_async_message(monitor_guard& guard) { - if (_owner.isClosed() || _owner.isPaused()) { + if (_owner.isPaused()) { return {}; } PriorityIdx& idx(bmi::get<1>(*_queue)); diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h index 819013e5c13..cfea488aff0 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h @@ -220,7 +220,6 @@ public: void addMergeStatus(const document::Bucket&, std::shared_ptr<MergeStatus>) override; MergeStatus& editMergeStatus(const document::Bucket&) override; bool isMerging(const document::Bucket&) const override; - uint32_t getNumActiveMerges() const override; void clearMergeStatus(const document::Bucket& bucket) override; void clearMergeStatus(const document::Bucket& bucket, const api::ReturnCode& code) override; diff --git a/storage/src/vespa/storage/persistence/persistencethread.cpp b/storage/src/vespa/storage/persistence/persistencethread.cpp index 5738e2257ae..b4eedbb97f3 100644 --- a/storage/src/vespa/storage/persistence/persistencethread.cpp +++ b/storage/src/vespa/storage/persistence/persistencethread.cpp @@ -33,7 +33,7 @@ PersistenceThread::run(framework::ThreadHandle& thread) { LOG(debug, "Started persistence thread"); - while (!thread.interrupted() && !_fileStorHandler.closed()) { + while (!thread.interrupted()) { thread.registerTick(); FileStorHandler::LockedMessage lock(_fileStorHandler.getNextMessage(_stripeId)); |