Skip to content

Commit

Permalink
Revert "Support auto regist (#3548)" (#3592)
Browse files Browse the repository at this point in the history
This reverts commit 6849383.

Co-authored-by: Yee <[email protected]>
  • Loading branch information
critical27 and yixinglu authored Dec 29, 2021
1 parent f749d77 commit 6dd7446
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 10 deletions.
4 changes: 1 addition & 3 deletions src/meta/processors/admin/HBProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions src/meta/processors/admin/HBProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "common/stats/StatsManager.h"
#include "meta/processors/BaseProcessor.h"

DECLARE_bool(hosts_whitelist_enabled);

namespace nebula {
namespace meta {

Expand Down
1 change: 0 additions & 1 deletion src/meta/test/HBProcessorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<kvstore::KVStore> kv(MockCluster::initMetaKV(rootPath.path()));

Expand Down
4 changes: 0 additions & 4 deletions src/meta/test/ProcessorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
{
Expand Down Expand Up @@ -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());
{
Expand Down Expand Up @@ -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());
{
Expand Down Expand Up @@ -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());
{
Expand Down

0 comments on commit 6dd7446

Please sign in to comment.