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

feat(split): update group partition count #392

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
small fix
hycdong committed May 7, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit aa24d2bb693d3711ba8e6f52e4cf700e9d29a962
9 changes: 4 additions & 5 deletions src/dist/replication/lib/replica_split.cpp
Original file line number Diff line number Diff line change
@@ -777,11 +777,10 @@ void replica::update_group_partition_count(int32_t new_partition_count,
return;
}

// _primary_states.statuses is a map structure: rpc address -> partition_status
std::unordered_set<dsn::rpc_address> not_replied_addresses;
for (auto iter = _primary_states.statuses.begin(); iter != _primary_states.statuses.end();
++iter) {
not_replied_addresses.insert(iter->first);
// _primary_states.statuses is a map structure: rpc address -> partition_status
for (const auto &kv : _primary_states.statuses) {
not_replied_addresses.insert(kv.first);
}

ddebug_replica("start to update {} group partition count, new partition count = {}, ",
@@ -846,7 +845,7 @@ void replica::on_update_group_partition_count(

// update _app_info and partition_version
auto info = _app_info;
// if app has not been splitted before, init_partition_count = -1
// if app has not been split before, init_partition_count = -1
// we should set init_partition_count to old_partition_count
if (info.init_partition_count < 1) {
info.init_partition_count = info.partition_count;