aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2021-04-19 13:27:12 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2021-04-21 14:38:42 +0000
commite0d7b4ae709383ff005b7b6deef5cd3c79aabdb6 (patch)
treebd0bded76c6ef4444aad99f5c0b6a9fa0f01ba1c /storageapi
parentdc0bca9a4329ac6d4a000cf410e5b784f45bb2e5 (diff)
Initial implementation and wiring of cross-stripe state and DB handling
Introduces the concept of stripe access guards, that ensure safe and non-concurrent access to the underlying state of all running distributor stripes. Also bring back a top-level `BucketDBUpdater` component responsible for managing cluster state/distribution config and all related bucket info fetching for the entire node as a whole. This component abstracts away all stripe-specific operations via the new guard interface. For now, only a single stripe can be used via the new code path, and by default the legacy code path (single stripe acts as an entire distirbutor) is used. New path may be enabled via (non-live) config, but is not yet production ready.
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/vespa/storageapi/message/bucket.cpp6
-rw-r--r--storageapi/src/vespa/storageapi/message/bucket.h7
2 files changed, 9 insertions, 4 deletions
diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp
index fdc19d63134..2e2ca82079d 100644
--- a/storageapi/src/vespa/storageapi/message/bucket.cpp
+++ b/storageapi/src/vespa/storageapi/message/bucket.cpp
@@ -509,7 +509,8 @@ std::ostream& operator<<(std::ostream& out, const RequestBucketInfoReply::Entry&
RequestBucketInfoReply::RequestBucketInfoReply(const RequestBucketInfoCommand& cmd)
: StorageReply(cmd),
- _buckets()
+ _buckets(),
+ _full_bucket_fetch(cmd.hasSystemState())
{ }
RequestBucketInfoReply::~RequestBucketInfoReply() = default;
@@ -519,6 +520,9 @@ RequestBucketInfoReply::print(std::ostream& out, bool verbose,
const std::string& indent) const
{
out << "RequestBucketInfoReply(" << _buckets.size();
+ if (_full_bucket_fetch) {
+ out << ", full fetch";
+ }
if (verbose) {
out << "\n" << indent << " ";
std::copy(_buckets.begin(), _buckets.end(),
diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h
index cde440b91de..61766fb1f11 100644
--- a/storageapi/src/vespa/storageapi/message/bucket.h
+++ b/storageapi/src/vespa/storageapi/message/bucket.h
@@ -338,9 +338,8 @@ class RequestBucketInfoCommand : public StorageCommand {
vespalib::string _distributionHash;
public:
- explicit RequestBucketInfoCommand(
- document::BucketSpace bucketSpace,
- const std::vector<document::BucketId>& buckets);
+ RequestBucketInfoCommand(document::BucketSpace bucketSpace,
+ const std::vector<document::BucketId>& buckets);
RequestBucketInfoCommand(document::BucketSpace bucketSpace,
uint16_t distributor,
const lib::ClusterState& state,
@@ -388,6 +387,7 @@ public:
typedef vespalib::Array<Entry> EntryVector;
private:
EntryVector _buckets;
+ bool _full_bucket_fetch;
public:
@@ -395,6 +395,7 @@ public:
~RequestBucketInfoReply();
const EntryVector & getBucketInfo() const { return _buckets; }
EntryVector & getBucketInfo() { return _buckets; }
+ [[nodiscard]] bool full_bucket_fetch() const noexcept { return _full_bucket_fetch; }
void print(std::ostream& out, bool verbose, const std::string& indent) const override;
DECLARE_STORAGEREPLY(RequestBucketInfoReply, onRequestBucketInfoReply)
};