diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-06-24 12:07:08 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-06-24 21:07:27 +0000 |
commit | 889f5f60aed5ef60d486fea07b051052da004970 (patch) | |
tree | 94bafea581f9c156cd101ec87595dcd1a10fd80b /storageapi/src | |
parent | 4bb24d31ec0014ebd9e3dce7d4acf11ae98b9ac6 (diff) |
Avoid race condition regression introduced in #18179
We would previously check for the presence of pending null-bucket
`RequestBucketInfoCommand`s to determine if a pending cluster state
was present. We would also attempt to block all bucket delete operations
from starting if _any_ operation was pending towards that bucket on
a given node, including bucket info requests. The former was rewritten
to instead explicitly consider pending cluster state checks instead,
as checking null buckets no longer works when using stripes.
Unfortunately, due to a long-standing bug with message tracking of
`RequestBucketInfoCommand`s, these would _always_ be marked as pending
towards the null bucket. Since all ideal state ops would be blocked
by null-bucket info requests, this would avoid starting any ideal
state op as long as _any_ other op had an info request pending for
the target node. This had the desirable (but not explicitly coded for)
side effect of inhibiting bucket deletions from racing with half-finished
merge operations. It also had the undesirable effect of needlessly
blocking ops for completely unrelated buckets.
With these changes, we now explicitly handle bucket info requests for
single buckets in the `PendingMessageTracker`, allowing inhibition
of deletions to work as expected. Also add an explicit check for
pending info requests for all ideal state ops to mirror the old
behavior (but now per-bucket instead of globally...!).
Diffstat (limited to 'storageapi/src')
-rw-r--r-- | storageapi/src/vespa/storageapi/message/bucket.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp index 2323a1ab0a4..0f03c63ca93 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.cpp +++ b/storageapi/src/vespa/storageapi/message/bucket.cpp @@ -493,6 +493,8 @@ RequestBucketInfoCommand::print(std::ostream& out, bool verbose, if (hasSystemState()) { out << "distributor " << _distributor << " in "; _state->print(out, verbose, indent + " "); + } else if (super_bucket_id().isSet()) { + out << ", super bucket " << super_bucket_id() << ". "; } if (verbose && !_buckets.empty()) { out << "\n" << indent << " Specified buckets:\n" << indent << " "; @@ -529,6 +531,8 @@ RequestBucketInfoReply::print(std::ostream& out, bool verbose, out << "RequestBucketInfoReply(" << _buckets.size(); if (_full_bucket_fetch) { out << ", full fetch"; + } else if (super_bucket_id().isSet()) { + out << ", super bucket " << super_bucket_id(); } if (verbose) { out << "\n" << indent << " "; |