diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-05-10 14:08:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 14:08:17 +0200 |
commit | b296aacc11999b0ca156b7d023ec5a9f3ec2543b (patch) | |
tree | 395e56c962d688dbc1da255f1cdec82300df4bea /storage | |
parent | d344dff9c7a62a6cd821ad583789fcd8eb13dcbd (diff) | |
parent | 1bb2e61aef036ad2332d391e1d74d3e082abfd36 (diff) |
Merge pull request #17795 from vespa-engine/geirst/fix-distribution-config-propagation-in-new-stripe-mode
Propagate config to underlying bucket repos when storage distribution…
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/distributor/bucketdbupdater.cpp | 13 | ||||
-rw-r--r-- | storage/src/vespa/storage/distributor/bucketdbupdater.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp index d903a818270..e407d57fd43 100644 --- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp +++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp @@ -74,6 +74,18 @@ BucketDBUpdater::bootstrap_distribution_config(std::shared_ptr<const lib::Distri // ... need to take a guard if so, so can probably not be done at ctor time..? } +void +BucketDBUpdater::propagate_distribution_config(const BucketSpaceDistributionConfigs& configs) { + for (auto* repo : {&_op_ctx.bucket_space_repo(), &_op_ctx.read_only_bucket_space_repo()}) { + if (auto distr = configs.get_or_nullptr(document::FixedBucketSpaces::default_space())) { + repo->get(document::FixedBucketSpaces::default_space()).setDistribution(distr); + } + if (auto distr = configs.get_or_nullptr(document::FixedBucketSpaces::global_space())) { + repo->get(document::FixedBucketSpaces::global_space()).setDistribution(distr); + } + } +} + // FIXME what about bucket DB replica update timestamp allocations?! Replace with u64 counter..? // Must at the very least ensure we use stripe-local TS generation for DB inserts...! i.e. no global TS // Or do we have to touch these at all here? Just defer all this via stripe interface? @@ -179,6 +191,7 @@ BucketDBUpdater::complete_transition_timer() void BucketDBUpdater::storage_distribution_changed(const BucketSpaceDistributionConfigs& configs) { + propagate_distribution_config(configs); ensure_transition_timer_started(); auto guard = _stripe_accessor.rendezvous_and_hold_all(); diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.h b/storage/src/vespa/storage/distributor/bucketdbupdater.h index f5f5c7f0c2d..1ec48aa4d63 100644 --- a/storage/src/vespa/storage/distributor/bucketdbupdater.h +++ b/storage/src/vespa/storage/distributor/bucketdbupdater.h @@ -57,6 +57,7 @@ public: void resend_delayed_messages(); void storage_distribution_changed(const BucketSpaceDistributionConfigs& configs); void bootstrap_distribution_config(std::shared_ptr<const lib::Distribution>); + void propagate_distribution_config(const BucketSpaceDistributionConfigs& configs); vespalib::string report_xml_status(vespalib::xml::XmlOutputStream& xos, const framework::HttpUrlPath&) const; |