Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(split): add child partition check during config_sync #788

Merged
merged 2 commits into from
Mar 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,11 @@ void replica_stub::get_local_replicas(std::vector<replica_info> &replicas)

for (auto &pairs : _replicas) {
replica_ptr &rep = pairs.second;
// child partition should not sync config from meta server
// because it is not ready in meta view
if (rep->status() == partition_status::PS_PARTITION_SPLIT) {
continue;
}
replica_info info;
get_replica_info(info, rep);
replicas.push_back(std::move(info));
Expand Down Expand Up @@ -1426,7 +1431,8 @@ void replica_stub::on_node_query_reply_scatter(replica_stub_ptr this_,
void replica_stub::on_node_query_reply_scatter2(replica_stub_ptr this_, gpid id)
{
replica_ptr replica = get_replica(id);
if (replica != nullptr && replica->status() != partition_status::PS_POTENTIAL_SECONDARY) {
if (replica != nullptr && replica->status() != partition_status::PS_POTENTIAL_SECONDARY &&
replica->status() != partition_status::PS_PARTITION_SPLIT) {
if (replica->status() == partition_status::PS_INACTIVE &&
dsn_now_ms() - replica->create_time_milliseconds() <
_options.gc_memory_replica_interval_ms) {
Expand Down Expand Up @@ -2567,7 +2573,7 @@ void replica_stub::create_child_replica(rpc_address primary_address,
{
replica_ptr child_replica = create_child_replica_if_not_found(child_gpid, &app, parent_dir);
if (child_replica != nullptr) {
ddebug_f("create child replica ({}) succeed", child_gpid);
ddebug_f("app({}), create child replica ({}) succeed", app.app_name, child_gpid);
tasking::enqueue(LPC_PARTITION_SPLIT,
child_replica->tracker(),
std::bind(&replica_split_manager::child_init_replica,
Expand Down