From 5d453179adf77ed2fe8db8fe4d57ef4bd22fc0df Mon Sep 17 00:00:00 2001 From: Miroslav Crnic Date: Mon, 20 May 2024 13:10:31 +0000 Subject: [PATCH] cdc: dont alert on missing replicas if replication is off --- cpp/cdc/CDC.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/cdc/CDC.cpp b/cpp/cdc/CDC.cpp index 71f48657..8097ac12 100644 --- a/cpp/cdc/CDC.cpp +++ b/cpp/cdc/CDC.cpp @@ -936,7 +936,7 @@ struct CDCRegisterer : PeriodicLoop { uint16_t _shucklePort; XmonNCAlert _alert; ReplicaId _replicaId; - bool _registerCompleted; + bool _dontDoReplication; public: CDCRegisterer(Logger& logger, std::shared_ptr& xmon, const CDCOptions& options, CDCShared& shared): PeriodicLoop(logger, xmon, "registerer", { 1_sec, 1_mins }), @@ -944,7 +944,8 @@ public: _shuckleHost(options.shuckleHost), _shucklePort(options.shucklePort), _alert(10_sec), - _replicaId(options.replicaId) + _replicaId(options.replicaId), + _dontDoReplication(options.dontDoReplication) {} virtual ~CDCRegisterer() = default; @@ -981,7 +982,7 @@ public: ++emptyReplicas; } } - if (emptyReplicas > LogsDB::REPLICA_COUNT / 2 ) { + if (!_dontDoReplication && emptyReplicas > LogsDB::REPLICA_COUNT / 2 ) { _env.updateAlert(_alert, "Didn't get enough replicas with known addresses from shuckle"); return false; }