diff options
Diffstat (limited to 'storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp')
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index 45bcd6a98b5..1984d44652a 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "filestorhandlerimpl.h" #include "filestormetrics.h" @@ -14,7 +14,6 @@ #include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/string_escape.h> -#include <xxhash.h> #include <vespa/log/log.h> LOG_SETUP(".persistence.filestor.handler.impl"); @@ -896,8 +895,7 @@ FileStorHandlerImpl::flush() uint64_t FileStorHandlerImpl::dispersed_bucket_bits(const document::Bucket& bucket) noexcept { - const uint64_t raw_id = bucket.getBucketId().getId(); - return XXH3_64bits(&raw_id, sizeof(uint64_t)); + return vespalib::xxhash::xxh3_64(bucket.getBucketId().getId()); } FileStorHandlerImpl::Stripe::Stripe(const FileStorHandlerImpl & owner, MessageSender & messageSender) @@ -1129,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: @@ -1137,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; } |