From 6bf40621a645eead4e284c47e7620e0ae206d553 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Tue, 23 Jul 2024 01:23:45 +0800 Subject: [PATCH] fix --- src/meta/meta_data.cpp | 3 ++- src/runtime/rpc/rpc_host_port.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/meta/meta_data.cpp b/src/meta/meta_data.cpp index c7359aac15..3c9d8be9e4 100644 --- a/src/meta/meta_data.cpp +++ b/src/meta/meta_data.cpp @@ -136,7 +136,8 @@ bool construct_replica(meta_view view, const gpid &pid, int max_replica_count) GET_HOST_PORTS(pc, last_drops, last_drops); CHECK(last_drops.empty(), "last_drops of partition({}) must be empty", pid); for (auto iter = drop_list.rbegin(); iter != drop_list.rend(); ++iter) { - if (last_drops.size() + 1 >= max_replica_count) { + // hp_last_drops is added in the steps bellow. + if (pc.hp_last_drops.size() + 1 >= max_replica_count) { break; } // similar to cc.drop_list, pc.last_drop is also a stack structure diff --git a/src/runtime/rpc/rpc_host_port.h b/src/runtime/rpc/rpc_host_port.h index 7e34714010..196605b1ff 100644 --- a/src/runtime/rpc/rpc_host_port.h +++ b/src/runtime/rpc/rpc_host_port.h @@ -132,6 +132,7 @@ class TProtocol; auto &_obj = (obj); \ _obj.field.set_invalid(); \ _obj.hp_##field.reset(); \ + _obj.__isset.hp_##field = false; \ } while (0) // Clear the '' and optional 'hp_' of 'obj'. The types of the fields are std::vector @@ -140,7 +141,8 @@ class TProtocol; do { \ auto &_obj = (obj); \ _obj.field.clear(); \ - _obj.__set_hp_##field({}); \ + _obj.hp_##field.clear(); \ + _obj.__isset.hp_##field = false; \ } while (0) // Add 'addr' and 'hp' to the vector '' and optional vector 'hp_' of 'obj'. The types