Skip to content

Commit

Permalink
Print message to notify user: infinity server is started
Browse files Browse the repository at this point in the history
Signed-off-by: Jin Hai <[email protected]>
  • Loading branch information
JinHai-CN committed Nov 23, 2024
1 parent 94cb416 commit 62af274
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/infinity_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void InfinityContext::InitPhase2() {
if (config_->ServerMode() == "cluster") {
// Admin mode or cluster start phase
infinity_context_inited_ = true;
// fmt::print("Infinity is started as a cluster node.\n");
return;
}

Expand Down Expand Up @@ -148,6 +149,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return set_storage_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started in standalone mode.\n");
break;
}
case NodeRole::kLeader: {
Expand All @@ -163,6 +165,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return set_storage_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a leader node.\n");
break;
}
case NodeRole::kFollower: {
Expand All @@ -182,6 +185,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return init_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a follower node.\n");
break;
}
case NodeRole::kLearner: {
Expand All @@ -201,6 +205,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return init_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a learner node.\n");
break;
}
case NodeRole::kUnInitialized: {
Expand Down Expand Up @@ -304,6 +309,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return init_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a follower node.\n");
break;
}
case NodeRole::kLearner: {
Expand All @@ -326,6 +332,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
return init_status;
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a learner node.\n");
break;
}
case NodeRole::kStandalone: {
Expand Down Expand Up @@ -415,6 +422,7 @@ Status InfinityContext::ChangeServerRole(NodeRole target_role, bool from_leader,
UnrecoverableError("Failed to set node storage to leader.");
}
infinity_context_started_ = true;
fmt::print("Infinity is started as a leader node.\n");
break;
}
default: {
Expand Down

0 comments on commit 62af274

Please sign in to comment.