Skip to content

Commit

Permalink
merge feat(split): parent group update partition count XiaoMi#654
Browse files Browse the repository at this point in the history
  • Loading branch information
hycdong committed Nov 26, 2020
1 parent 32fb2b8 commit cbd4def
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/replica/replica_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void replica::on_group_check(const group_check_request &request,
if (request.last_committed_decree > last_committed_decree()) {
_prepare_list->commit(request.last_committed_decree, COMMIT_TO_DECREE_HARD);
}
_split_mgr->secondary_parent_handle_split(request, response);
_split_mgr->trigger_secondary_parent_split(request, response);
break;
case partition_status::PS_POTENTIAL_SECONDARY:
init_learn(request.config.learner_signature);
Expand Down
2 changes: 1 addition & 1 deletion src/replica/split/replica_split_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ void replica_split_manager::check_partition_count(
}

// ThreadPool: THREAD_POOL_REPLICATION
void replica_split_manager::secondary_parent_handle_split(
void replica_split_manager::trigger_secondary_parent_split(
const group_check_request &request,
/*out*/ group_check_response &response) // on secondary parent partition
{
Expand Down
6 changes: 3 additions & 3 deletions src/replica/split/replica_split_manager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
Expand Down Expand Up @@ -151,8 +151,8 @@ class replica_split_manager : replica_base

// called by `on_group_check` in `replica_check.cpp`
// secondary parent check whether should start or stop split
void secondary_parent_handle_split(const group_check_request &request,
/*out*/ group_check_response &response);
void trigger_secondary_parent_split(const group_check_request &request,
/*out*/ group_check_response &response);

// parent partition pause or cancel split
void parent_stop_split(split_status::type meta_split_status);
Expand Down
12 changes: 6 additions & 6 deletions src/replica/split/test/replica_split_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ class replica_split_test : public replica_test_base
_parent_replica->tracker()->wait_outstanding_tasks();
}

group_check_response test_secondary_parent_handle_split(split_status::type meta_split_status,
split_status::type local_split_status)
group_check_response test_trigger_secondary_parent_split(split_status::type meta_split_status,
split_status::type local_split_status)
{
_parent_replica->set_partition_status(partition_status::PS_SECONDARY);
parent_set_split_status(local_split_status);
Expand All @@ -363,7 +363,7 @@ class replica_split_test : public replica_test_base
}

group_check_response resp;
_parent_split_mgr->secondary_parent_handle_split(req, resp);
_parent_split_mgr->trigger_secondary_parent_split(req, resp);
_parent_replica->tracker()->wait_outstanding_tasks();

return resp;
Expand Down Expand Up @@ -859,7 +859,7 @@ TEST_F(replica_split_test, primary_handle_split_test)
}
}

// secondary_parent_handle_split unit test
// trigger_secondary_parent_split unit test
TEST_F(replica_split_test, secondary_handle_split_test)
{
generate_child();
Expand All @@ -872,7 +872,7 @@ TEST_F(replica_split_test, secondary_handle_split_test)
// - meta canceling with local not_split
// - meta canceling with local splitting
// - meta paused with local not_split
struct secondary_parent_handle_split_test
struct trigger_secondary_parent_split_test
{
split_status::type meta_split_status;
split_status::type local_split_status;
Expand All @@ -889,7 +889,7 @@ TEST_F(replica_split_test, secondary_handle_split_test)
mock_parent_split_context(partition_status::PS_SECONDARY);
}
auto resp =
test_secondary_parent_handle_split(test.meta_split_status, test.local_split_status);
test_trigger_secondary_parent_split(test.meta_split_status, test.local_split_status);
ASSERT_EQ(resp.err, ERR_OK);
ASSERT_TRUE(is_parent_not_in_split());
ASSERT_EQ(_parent_split_mgr->get_partition_version(), test.expected_partition_version);
Expand Down

0 comments on commit cbd4def

Please sign in to comment.