summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/persistence
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-08-30 10:31:26 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-08-30 10:33:07 +0000
commit8d19ccd64e7df0c795318ffc38f37b21a34e4fe4 (patch)
tree13f5a78bd9ffda54ad44f3ab323509cdd758133b /storage/src/tests/persistence
parentc7bcf3cb739b2a9665212da031cf45cb201d8126 (diff)
Force content node-internal bucket DB metric update during startup
After initialization, the node will immediately start communicating with the cluster controller, exchanging host info. This host info contains a subset snapshot of the active metrics, which includes the total bucket count, doc count etc. It is critical that we must never report back host info _prior_ to having run at least one full sweep of the bucket database, lest we risk transiently reporting zero buckets held by the content node. Doing so could cause orchestration logic to perform operations based on erroneous assumptions. To avoid this, we explicitly force a full DB sweep and metric update prior to reporting the node as up. Since this function is called prior to the CommunicationManager thread being started, any CC health pings should also always happen after this init step.
Diffstat (limited to 'storage/src/tests/persistence')
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index 4c1b1662f68..a5f5075a4d8 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -1966,6 +1966,7 @@ TEST_F(FileStorManagerTest, bucket_db_is_populated_from_provider_when_initialize
getDummyPersistence().set_fake_bucket_set(buckets);
c.manager->initialize_bucket_databases_from_provider();
+ c.manager->complete_internal_initialization();
std::vector<std::pair<document::BucketId, api::BucketInfo>> from_db;
auto populate_from_db = [&from_db](uint64_t key, auto& entry) {