diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-05-03 12:49:57 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-05-03 12:49:57 +0000 |
commit | a4e1bdcf857daa21b0c6b7d40ad13f48260a946d (patch) | |
tree | d90af518d8e223684f0f96e14bd1c426a20ef1a1 /storage/src | |
parent | 6717a278312b4a85b83afcfb52276fe3c1e54da6 (diff) |
Ensure we do not call legacy `getConfig()` in common code paths
Also unconditionally update top-level Distributor's own config snapshot
so that it can be used for legacy code paths as well. Would ideally
remove all usages of legacy `getConfig()`, but we need to refactor
how unit tests sneakily inject config changes first.
Diffstat (limited to 'storage/src')
-rw-r--r-- | storage/src/vespa/storage/distributor/distributor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp index 04d8560298a..6975a2595ad 100644 --- a/storage/src/vespa/storage/distributor/distributor.cpp +++ b/storage/src/vespa/storage/distributor/distributor.cpp @@ -79,7 +79,7 @@ Distributor::Distributor(DistributorComponentRegister& compReg, _component.getDistribution(), *_stripe_accessor); } - _hostInfoReporter.enableReporting(getConfig().getEnableHostInfoReporting()); + _hostInfoReporter.enableReporting(config().getEnableHostInfoReporting()); _distributorStatusDelegate.registerStatusPage(); hostInfoReporterRegistrar.registerReporter(&_hostInfoReporter); propagateDefaultDistribution(_component.getDistribution()); @@ -443,14 +443,14 @@ Distributor::enableNextConfig() // TODO STRIPE rename to enable_next_config_if_c { // Only lazily trigger a config propagation and internal update if something has _actually changed_. if (_component.internal_config_generation() != _current_internal_config_generation) { + _total_config = _component.total_distributor_config_sp(); if (!_use_legacy_mode) { - _total_config = _component.total_distributor_config_sp(); auto guard = _stripe_accessor->rendezvous_and_hold_all(); guard->update_total_distributor_config(_component.total_distributor_config_sp()); } else { _stripe->update_total_distributor_config(_component.total_distributor_config_sp()); } - _hostInfoReporter.enableReporting(getConfig().getEnableHostInfoReporting()); + _hostInfoReporter.enableReporting(config().getEnableHostInfoReporting()); _current_internal_config_generation = _component.internal_config_generation(); } if (_use_legacy_mode) { |