summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2023-10-26 11:40:38 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2023-10-26 11:40:38 +0000
commitf27c64e37294fb34f21c4d4e1921119eace031a3 (patch)
tree2923dbbf1e0cc655bd6bf25e474d95fdeb4b2149 /storage
parent444b2217bc11103d01a1262c9baa84ee3a4eb4ef (diff)
Use same concurrency inhibition for DeleteBucket as for merge ops
This provides a strict upper bound for the number of concurrently executing DeleteBucket operations, and ensures that no persistence thread stripe can have all its threads allocated to processing bucket deletions.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index a96bee2d11a..1984d44652a 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -1127,7 +1127,7 @@ FileStorHandlerImpl::Stripe::flush()
namespace {
bool
-message_type_is_merge_related(api::MessageType::Id msg_type_id) {
+message_type_is_merge_related(api::MessageType::Id msg_type_id) noexcept {
switch (msg_type_id) {
case api::MessageType::MERGEBUCKET_ID:
case api::MessageType::MERGEBUCKET_REPLY_ID:
@@ -1135,6 +1135,11 @@ message_type_is_merge_related(api::MessageType::Id msg_type_id) {
case api::MessageType::GETBUCKETDIFF_REPLY_ID:
case api::MessageType::APPLYBUCKETDIFF_ID:
case api::MessageType::APPLYBUCKETDIFF_REPLY_ID:
+ // DeleteBucket is usually (but not necessarily) executed in the context of a higher-level
+ // merge operation, but we include it here since we want to enforce that not all threads
+ // in a stripe can dispatch a bucket delete at the same time. This also provides a strict
+ // upper bound on the number of in-flight bucket deletes in the persistence core.
+ case api::MessageType::DELETEBUCKET_ID:
return true;
default: return false;
}