Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Apr 29, 2024
1 parent d92ee86 commit b50be21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2039,18 +2039,17 @@ void server_state::on_partition_node_dead(std::shared_ptr<app_state> &app,
{
partition_configuration &pc = app->partitions[pidx];
if (app->is_stateful) {
if (is_primary(pc, node))
if (is_primary(pc, node)) {
downgrade_primary_to_inactive(app, pidx);
else if (is_secondary(pc, node)) {
if (pc.hp_primary)
} else if (is_secondary(pc, node)) {
if (pc.hp_primary) {
downgrade_secondary_to_inactive(app, pidx, node);
else if (is_secondary(pc, node)) {
} else {
CHECK(is_secondary(pc, node), "no primary/secondary on this node: {}", node);
LOG_INFO("gpid({}): secondary({}) is down, ignored it due to no primary for this "
"partition available",
pc.pid,
node);
} else {
CHECK(false, "no primary/secondary on this node, node node = {}", node);
}
}
} else {
Expand Down
5 changes: 2 additions & 3 deletions src/meta/server_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ class server_state
void
downgrade_stateless_nodes(std::shared_ptr<app_state> &app, int pidx, const host_port &node);

void on_partition_node_dead(std::shared_ptr<app_state> &app,
int pidx,
const dsn::host_port &node);
void
on_partition_node_dead(std::shared_ptr<app_state> &app, int pidx, const dsn::host_port &node);
void send_proposal(const host_port &target, const configuration_update_request &proposal);
void send_proposal(const configuration_proposal_action &action,
const partition_configuration &pc,
Expand Down

0 comments on commit b50be21

Please sign in to comment.