summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-23 21:12:52 +0100
committerGitHub <noreply@github.com>2021-11-23 21:12:52 +0100
commit6e7385e7858ee5491f028c7012d9928ea340d678 (patch)
tree20706e75771d68979fa5b6219f49791ed4dd4c8f /searchcore/src/tests/proton/documentdb
parenta2f9a7b7d6afcd9e9567e53e5a0f489bddaf3cb4 (diff)
parent3d31f8967fc8970835b14a615f393ec4acda3394 (diff)
Merge pull request #20156 from vespa-engine/vekterli/allow-searches-when-node-is-in-maintenance-mode
Continue serving search queries when in Maintenance node state [run-systemtest]
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
-rw-r--r--searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
index 29748a2010c..cadfa8cd72f 100644
--- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
@@ -140,6 +140,11 @@ struct Fixture
setNodeUp(bool value)
{
_calc->setNodeUp(value);
+ _calc->setNodeMaintenance(false);
+ _handler.notifyClusterStateChanged(_calc);
+ }
+ void setNodeMaintenance(bool value) {
+ _calc->setNodeMaintenance(value);
_handler.notifyClusterStateChanged(_calc);
}
};
@@ -223,7 +228,7 @@ TEST_F("require that unready bucket can be reported as active", Fixture)
}
-TEST_F("require that node being down deactivates buckets", Fixture)
+TEST_F("node going down (but not into maintenance state) deactivates all buckets", Fixture)
{
f._handler.handleSetCurrentState(f._ready.bucket(2),
BucketInfo::ACTIVE, f._genResult);
@@ -252,6 +257,42 @@ TEST_F("require that node being down deactivates buckets", Fixture)
EXPECT_EQUAL(true, f._bucketInfo.getInfo().isActive());
}
+TEST_F("node going into maintenance state does _not_ deactivate any buckets", Fixture)
+{
+ f._handler.handleSetCurrentState(f._ready.bucket(2),
+ BucketInfo::ACTIVE, f._genResult);
+ f.sync();
+ f.setNodeMaintenance(true);
+ f.sync();
+ f.handleGetBucketInfo(f._ready.bucket(2));
+ EXPECT_TRUE(f._bucketInfo.getInfo().isActive());
+}
+
+TEST_F("node going from maintenance to up state deactivates all buckets", Fixture)
+{
+ f._handler.handleSetCurrentState(f._ready.bucket(2),
+ BucketInfo::ACTIVE, f._genResult);
+ f.sync();
+ f.setNodeMaintenance(true);
+ f.sync();
+ f.setNodeUp(true);
+ f.sync();
+ f.handleGetBucketInfo(f._ready.bucket(2));
+ EXPECT_FALSE(f._bucketInfo.getInfo().isActive());
+}
+
+TEST_F("node going from maintenance to down state deactivates all buckets", Fixture)
+{
+ f._handler.handleSetCurrentState(f._ready.bucket(2),
+ BucketInfo::ACTIVE, f._genResult);
+ f.sync();
+ f.setNodeMaintenance(true);
+ f.sync();
+ f.setNodeUp(false);
+ f.sync();
+ f.handleGetBucketInfo(f._ready.bucket(2));
+ EXPECT_FALSE(f._bucketInfo.getInfo().isActive());
+}
TEST_MAIN()
{