From 6dd7446db4b6d3ed8c38759c806ff4251de6cf37 Mon Sep 17 00:00:00 2001 From: Doodle <13706157+critical27@users.noreply.github.com> Date: Wed, 29 Dec 2021 06:27:46 -0600 Subject: [PATCH] Revert "Support auto regist (#3548)" (#3592) This reverts commit 68493839c619872725ba96388cca5c3e7792e8d4. Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> --- src/meta/processors/admin/HBProcessor.cpp | 4 +--- src/meta/processors/admin/HBProcessor.h | 2 -- src/meta/test/HBProcessorTest.cpp | 1 - src/meta/test/ProcessorTest.cpp | 4 ---- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/meta/processors/admin/HBProcessor.cpp b/src/meta/processors/admin/HBProcessor.cpp index 2012e42e251..7e78aba9732 100644 --- a/src/meta/processors/admin/HBProcessor.cpp +++ b/src/meta/processors/admin/HBProcessor.cpp @@ -10,8 +10,6 @@ #include "meta/KVBasedClusterIdMan.h" #include "meta/MetaVersionMan.h" -DEFINE_bool(hosts_whitelist_enabled, true, "Automatically receive the heartbeat report"); - namespace nebula { namespace meta { @@ -36,7 +34,7 @@ void HBProcessor::process(const cpp2::HBReq& req) { << ", role = " << apache::thrift::util::enumNameSafe(role); if (role == cpp2::HostRole::STORAGE) { - if (!FLAGS_hosts_whitelist_enabled && !ActiveHostsMan::machineRegisted(kvstore_, host)) { + if (!ActiveHostsMan::machineRegisted(kvstore_, host)) { LOG(ERROR) << "Machine " << host << " is not registed"; handleErrorCode(nebula::cpp2::ErrorCode::E_MACHINE_NOT_FOUND); onFinished(); diff --git a/src/meta/processors/admin/HBProcessor.h b/src/meta/processors/admin/HBProcessor.h index 4974f781c77..4fde1b03bac 100644 --- a/src/meta/processors/admin/HBProcessor.h +++ b/src/meta/processors/admin/HBProcessor.h @@ -11,8 +11,6 @@ #include "common/stats/StatsManager.h" #include "meta/processors/BaseProcessor.h" -DECLARE_bool(hosts_whitelist_enabled); - namespace nebula { namespace meta { diff --git a/src/meta/test/HBProcessorTest.cpp b/src/meta/test/HBProcessorTest.cpp index 0773294711a..bbd619d579a 100644 --- a/src/meta/test/HBProcessorTest.cpp +++ b/src/meta/test/HBProcessorTest.cpp @@ -15,7 +15,6 @@ namespace nebula { namespace meta { TEST(HBProcessorTest, HBTest) { - FLAGS_hosts_whitelist_enabled = false; fs::TempDir rootPath("/tmp/HBTest.XXXXXX"); std::unique_ptr kv(MockCluster::initMetaKV(rootPath.path())); diff --git a/src/meta/test/ProcessorTest.cpp b/src/meta/test/ProcessorTest.cpp index 6fd6090c6f2..b942e98afdd 100644 --- a/src/meta/test/ProcessorTest.cpp +++ b/src/meta/test/ProcessorTest.cpp @@ -2681,7 +2681,6 @@ TEST(ProcessorTest, TagIdAndEdgeTypeInSpaceRangeTest) { } TEST(ProcessorTest, HostsTest) { - FLAGS_hosts_whitelist_enabled = false; fs::TempDir rootPath("/tmp/HostsTest.XXXXXX"); auto kv = MockCluster::initMetaKV(rootPath.path()); { @@ -2883,7 +2882,6 @@ TEST(ProcessorTest, HostsTest) { } TEST(ProcessorTest, AddHostsIntoNewZoneTest) { - FLAGS_hosts_whitelist_enabled = false; fs::TempDir rootPath("/tmp/AddHostsIntoZoneTest.XXXXXX"); auto kv = MockCluster::initMetaKV(rootPath.path()); { @@ -2985,7 +2983,6 @@ TEST(ProcessorTest, AddHostsIntoNewZoneTest) { } TEST(ProcessorTest, AddHostsIntoZoneTest) { - FLAGS_hosts_whitelist_enabled = false; fs::TempDir rootPath("/tmp/AddHostsIntoZoneTest.XXXXXX"); auto kv = MockCluster::initMetaKV(rootPath.path()); { @@ -3156,7 +3153,6 @@ TEST(ProcessorTest, AddHostsIntoZoneTest) { } TEST(ProcessorTest, DropHostsTest) { - FLAGS_hosts_whitelist_enabled = false; fs::TempDir rootPath("/tmp/DropHostsTest.XXXXXX"); auto kv = MockCluster::initMetaKV(rootPath.path()); {