summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2017-12-06 15:19:26 +0000
committerTor Egge <Tor.Egge@oath.com>2017-12-07 10:32:18 +0000
commit8535cbb1cfde7c23d4947a9b1a1e062b0469c722 (patch)
treeb8ed147de52e6597345119a05dcb44a7dd6ccd8b /searchcore/src/tests/proton/documentdb
parent351229b42387bbef47163e423f0c1c570f1dbeb1 (diff)
Use alternate maxflushed parameter (max number of flushed memory indexes
before fusion becomes urgent) when node is retired.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp36
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp12
2 files changed, 44 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 87efd74659d..d3567da3527 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -666,6 +666,42 @@ TEST("require that maintenance controller should change if some config has chang
TEST_DO(assertMaintenanceControllerShouldChange(CCR().setMaintenanceChanged(true)));
}
+void
+assertSubDbsShouldNotChange(DocumentDBConfig::ComparisonResult result)
+{
+ ReconfigParams params(result);
+ EXPECT_FALSE(params.configHasChanged());
+ EXPECT_FALSE(params.shouldSubDbsChange());
+}
+
+void
+assertSubDbsShouldChange(DocumentDBConfig::ComparisonResult result)
+{
+ ReconfigParams params(result);
+ EXPECT_TRUE(params.configHasChanged());
+ EXPECT_TRUE(params.shouldSubDbsChange());
+}
+
+
+TEST("require that subdbs should change if relevant config changed")
+{
+ TEST_DO(assertSubDbsShouldNotChange(CCR()));
+ EXPECT_FALSE(ReconfigParams(CCR().setMaintenanceChanged(true)).shouldSubDbsChange());
+ TEST_DO(assertSubDbsShouldChange(CCR().setFlushChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setStoreChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setDocumenttypesChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setDocumentTypeRepoChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setSummaryChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setSummarymapChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setJuniperrcChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setAttributesChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setImportedFieldsChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setVisibilityDelayChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setRankProfilesChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setRankingConstantsChanged(true)));
+ TEST_DO(assertSubDbsShouldChange(CCR().setSchemaChanged(true)));
+}
+
TEST_MAIN()
{
TEST_RUN_ALL();
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index b84aa1c1c6c..0f69684373c 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -497,7 +497,8 @@ public:
_mcCfg->getLidSpaceCompactionConfig(),
_mcCfg->getAttributeUsageFilterConfig(),
_mcCfg->getAttributeUsageSampleInterval(),
- _mcCfg->getBlockableJobConfig()));
+ _mcCfg->getBlockableJobConfig(),
+ _mcCfg->getFlushConfig()));
_mcCfg = newCfg;
forwardMaintenanceConfig();
}
@@ -514,7 +515,8 @@ public:
_mcCfg->getLidSpaceCompactionConfig(),
_mcCfg->getAttributeUsageFilterConfig(),
_mcCfg->getAttributeUsageSampleInterval(),
- _mcCfg->getBlockableJobConfig()));
+ _mcCfg->getBlockableJobConfig(),
+ _mcCfg->getFlushConfig()));
_mcCfg = newCfg;
forwardMaintenanceConfig();
}
@@ -531,7 +533,8 @@ public:
_mcCfg->getLidSpaceCompactionConfig(),
_mcCfg->getAttributeUsageFilterConfig(),
_mcCfg->getAttributeUsageSampleInterval(),
- _mcCfg->getBlockableJobConfig()));
+ _mcCfg->getBlockableJobConfig(),
+ _mcCfg->getFlushConfig()));
_mcCfg = newCfg;
forwardMaintenanceConfig();
}
@@ -546,7 +549,8 @@ public:
cfg,
_mcCfg->getAttributeUsageFilterConfig(),
_mcCfg->getAttributeUsageSampleInterval(),
- _mcCfg->getBlockableJobConfig()));
+ _mcCfg->getBlockableJobConfig(),
+ _mcCfg->getFlushConfig()));
_mcCfg = newCfg;
forwardMaintenanceConfig();
}