From fc6093c87e2ec0e771ab987b00d93991bb34be6e Mon Sep 17 00:00:00 2001 From: HeYuchen <377710264@qq.com> Date: Thu, 18 Mar 2021 09:58:32 +0800 Subject: [PATCH] feat(split): ignore split garbage partition while load replicas (#787) --- src/replica/replica_init.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/replica/replica_init.cpp b/src/replica/replica_init.cpp index a8b15ca53e..b129fe94e3 100644 --- a/src/replica/replica_init.cpp +++ b/src/replica/replica_init.cpp @@ -161,6 +161,14 @@ error_code replica::initialize_on_load() return nullptr; } + if (info.partition_count < pidx) { + derror_f("partition[{}], count={}, this replica may be partition split garbage partition, " + "ignore it", + pid, + info.partition_count); + return nullptr; + } + replica *rep = new replica(stub, pid, info, dir, false); err = rep->initialize_on_load();