diff options
author | Geir Storli <geirst@verizonmedia.com> | 2021-05-10 11:11:44 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2021-05-10 11:11:44 +0000 |
commit | 1bb2e61aef036ad2332d391e1d74d3e082abfd36 (patch) | |
tree | 4cf1e1eeb41592b82dd8a57bbd6da9e2eeef39d5 /storage | |
parent | bf3dc62f19af3e06656b397a87bac0dfeeeb0e70 (diff) |
Propagate config to underlying bucket repos when storage distribution changes.
This fixes the following system tests when running with new distributor stripe mode:
Capacity::test_capacity
FlatToHierarchicTransitionTest::test_transition_implicitly_indexes_and_activates_docs_per_group
HierarchDistr::test_app_change__PROTON
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; |