summaryrefslogtreecommitdiffstats
path: root/storage/src
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-20 15:37:55 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-20 16:56:58 +0100
commit9c7c9ceecbb58f1ee82d212a6347bd5ec676490d (patch)
treeab3de76c1412ce323ff295f2fb2294c81b77e516 /storage/src
parent83665fa55dc66388bd134136ac09c30fb93a99eb (diff)
Always allow activation commands through bouncer component
Otherwise we'd miss activation commands sent for a cluster state in which our own node is marked down.
Diffstat (limited to 'storage/src')
-rw-r--r--storage/src/tests/storageserver/bouncertest.cpp14
-rw-r--r--storage/src/vespa/storage/storageserver/bouncer.cpp1
2 files changed, 15 insertions, 0 deletions
diff --git a/storage/src/tests/storageserver/bouncertest.cpp b/storage/src/tests/storageserver/bouncertest.cpp
index 27c13a3707e..371c24accbc 100644
--- a/storage/src/tests/storageserver/bouncertest.cpp
+++ b/storage/src/tests/storageserver/bouncertest.cpp
@@ -43,6 +43,7 @@ struct BouncerTest : public CppUnit::TestFixture {
void outOfBoundsConfigValuesThrowException();
void abort_request_when_derived_bucket_space_node_state_is_marked_down();
void client_operations_are_allowed_through_on_cluster_state_down_distributor();
+ void cluster_state_activation_commands_are_not_bounced();
CPPUNIT_TEST_SUITE(BouncerTest);
CPPUNIT_TEST(testFutureTimestamp);
@@ -57,6 +58,7 @@ struct BouncerTest : public CppUnit::TestFixture {
CPPUNIT_TEST(outOfBoundsConfigValuesThrowException);
CPPUNIT_TEST(abort_request_when_derived_bucket_space_node_state_is_marked_down);
CPPUNIT_TEST(client_operations_are_allowed_through_on_cluster_state_down_distributor);
+ CPPUNIT_TEST(cluster_state_activation_commands_are_not_bounced);
CPPUNIT_TEST_SUITE_END();
using Priority = api::StorageMessage::Priority;
@@ -368,5 +370,17 @@ void BouncerTest::client_operations_are_allowed_through_on_cluster_state_down_di
CPPUNIT_ASSERT_EQUAL(uint64_t(0), _manager->metrics().unavailable_node_aborts.getValue());
}
+void BouncerTest::cluster_state_activation_commands_are_not_bounced() {
+ tearDown();
+ setUpAsNode(lib::NodeType::DISTRIBUTOR);
+
+ auto state = makeClusterStateBundle("version:10 distributor:3 .2.s:d storage:3", {}); // Our index (2) is down
+ _node->getNodeStateUpdater().setClusterStateBundle(state);
+
+ auto activate_cmd = std::make_shared<api::ActivateClusterStateVersionCommand>(11);
+ _upper->sendDown(activate_cmd);
+ assertMessageNotBounced();
+}
+
} // storage
diff --git a/storage/src/vespa/storage/storageserver/bouncer.cpp b/storage/src/vespa/storage/storageserver/bouncer.cpp
index 0541c7322f1..fdbfd553315 100644
--- a/storage/src/vespa/storage/storageserver/bouncer.cpp
+++ b/storage/src/vespa/storage/storageserver/bouncer.cpp
@@ -235,6 +235,7 @@ Bouncer::onDown(const std::shared_ptr<api::StorageMessage>& msg)
case api::MessageType::SETNODESTATE_ID:
case api::MessageType::GETNODESTATE_ID:
case api::MessageType::SETSYSTEMSTATE_ID:
+ case api::MessageType::ACTIVATE_CLUSTER_STATE_VERSION_ID:
case api::MessageType::NOTIFYBUCKETCHANGE_ID:
// state commands are always ok
return false;