diff options
7 files changed, 22 insertions, 27 deletions
diff --git a/document/src/vespa/document/repo/document_type_repo_factory.cpp b/document/src/vespa/document/repo/document_type_repo_factory.cpp index becf4face92..7033d29c7c2 100644 --- a/document/src/vespa/document/repo/document_type_repo_factory.cpp +++ b/document/src/vespa/document/repo/document_type_repo_factory.cpp @@ -32,6 +32,8 @@ EmptyFactoryCheck emptyFactoryCheck; } +DocumentTypeRepoFactory::DocumentTypeRepoEntry::~DocumentTypeRepoEntry() = default; + /* * Class handling deletion of document type repo after last reference is gone. */ diff --git a/document/src/vespa/document/repo/document_type_repo_factory.h b/document/src/vespa/document/repo/document_type_repo_factory.h index 4bf65d61645..eab8d7a2879 100644 --- a/document/src/vespa/document/repo/document_type_repo_factory.h +++ b/document/src/vespa/document/repo/document_type_repo_factory.h @@ -30,6 +30,8 @@ class DocumentTypeRepoFactory { config(std::move(config_in)) { } + DocumentTypeRepoEntry(DocumentTypeRepoEntry &&) = default; + ~DocumentTypeRepoEntry(); }; using DocumentTypeRepoMap = std::map<const void *, DocumentTypeRepoEntry>; class Deleter; diff --git a/storage/src/vespa/storage/distributor/distributor_bucket_space.cpp b/storage/src/vespa/storage/distributor/distributor_bucket_space.cpp index 784ae5ab8af..9ec4d31eb32 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space.cpp +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space.cpp @@ -127,7 +127,17 @@ setup_ideal_nodes_bundle(IdealServiceLayerNodesBundle& ideal_nodes_bundle, ideal_nodes_bundle.set_available_nonretired_or_maintenance_nodes(distribution.getIdealStorageNodes(cluster_state, bucket, nonretired_or_maintenance_up_states)); } -// Ideal service layer nodes bundle used when bucket id used bits > 33. +/* + * Check if we trigger a streaming search latency optimization where + * we spread out data for a single group over multiple storage nodes. + * See storage::lib::Distribution::getStorageSeed for details. + */ +bool is_split_group_bucket(document::BucketId bucket) noexcept +{ + return bucket.getUsedBits() > 33; +} + +// Ideal service layer nodes bundle used when is_split_group_bucket returns true thread_local IdealServiceLayerNodesBundle fallback_ideal_nodes_bundle; } @@ -136,12 +146,12 @@ const IdealServiceLayerNodesBundle& DistributorBucketSpace::get_ideal_service_layer_nodes_bundle(document::BucketId bucket) const { assert(bucket.getUsedBits() >= _distribution_bits); - if (bucket.getUsedBits() > 33) { + if (is_split_group_bucket(bucket)) { IdealServiceLayerNodesBundle &ideal_nodes_bundle = fallback_ideal_nodes_bundle; setup_ideal_nodes_bundle(ideal_nodes_bundle, *_distribution, *_clusterState, bucket); return ideal_nodes_bundle; } - document::BucketId lookup_bucket((bucket.getUsedBits() > 33) ? bucket.getUsedBits() : _distribution_bits, bucket.getId()); + document::BucketId lookup_bucket(is_split_group_bucket(bucket) ? bucket.getUsedBits() : _distribution_bits, bucket.getId()); auto itr = _ideal_nodes.find(lookup_bucket); if (itr != _ideal_nodes.end()) { return itr->second; 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)); |