diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2019-02-19 13:25:21 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2019-02-22 15:55:07 +0000 |
commit | f5414eadef7354893f64032d7ed1779777875502 (patch) | |
tree | bf0efa90f7c3f72206b40f8c12375ba7a6e97eed /storage/src/tests/common/teststorageapp.cpp | |
parent | 8bd7b6534fab28d507629fca1c109fff65585c40 (diff) |
Fail client ops gracefully when distributor is marked down
Previously, clients would only receive `ABORTED` when the distributor was
marked down by orchestration. This would simply cause the client to resend
until either the `StoragePolicy` would discard the cluster state entirely
and retry against a working distributor, or the operations would time out.
Now they will receive a `WrongDistributionReply` that shall immediately update
the `StoragePolicy` to avoid sending to the distributor that has been
marked down.
Also add a separate metric for number of operations aborted by `Bouncer`.
This fixes #8448.
Diffstat (limited to 'storage/src/tests/common/teststorageapp.cpp')
-rw-r--r-- | storage/src/tests/common/teststorageapp.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp index 8fd80d47bb3..a720cd191e4 100644 --- a/storage/src/tests/common/teststorageapp.cpp +++ b/storage/src/tests/common/teststorageapp.cpp @@ -248,8 +248,7 @@ TestDistributorApp::configure(vespalib::stringref id) TestDistributorApp::TestDistributorApp(vespalib::stringref configId) : TestStorageApp( - StorageComponentRegisterImpl::UP( - new DistributorComponentRegisterImpl), + std::make_unique<DistributorComponentRegisterImpl>(), lib::NodeType::DISTRIBUTOR, getIndexFromConfig(configId), configId), _compReg(dynamic_cast<DistributorComponentRegisterImpl&>( TestStorageApp::getComponentRegister())), @@ -263,7 +262,7 @@ TestDistributorApp::TestDistributorApp(vespalib::stringref configId) TestDistributorApp::TestDistributorApp(NodeIndex index, vespalib::stringref configId) : TestStorageApp( - StorageComponentRegisterImpl::UP(new StorageComponentRegisterImpl), + std::make_unique<DistributorComponentRegisterImpl>(), lib::NodeType::DISTRIBUTOR, index, configId), _compReg(dynamic_cast<DistributorComponentRegisterImpl&>( TestStorageApp::getComponentRegister())), |