Skip to content

Commit 3ac98fd

Browse files
committed
fix: address comments
1 parent 6afe123 commit 3ac98fd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/server/cluster/cluster_defs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ enum class NodeHealth : std::uint8_t { FAIL, LOADING, ONLINE, HIDDEN };
9898
std::string_view ToString(NodeHealth nh);
9999

100100
struct ClusterExtendedNodeInfo : ClusterNodeInfo {
101-
NodeHealth health = NodeHealth::FAIL;
101+
NodeHealth health = NodeHealth::ONLINE;
102102
};
103103

104104
struct MigrationInfo {

src/server/cluster/cluster_family.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void ClusterNodesImpl(const ClusterShardInfos& config, string_view my_id,
307307

308308
string result;
309309

310-
auto WriteNode = [&](const ClusterNodeInfo& node, string_view role, string_view master_id,
310+
auto WriteNode = [&](const ClusterExtendedNodeInfo& node, string_view role, string_view master_id,
311311
const SlotRanges& ranges) {
312312
absl::StrAppend(&result, node.id, " ");
313313

@@ -320,7 +320,8 @@ void ClusterNodesImpl(const ClusterShardInfos& config, string_view my_id,
320320

321321
absl::StrAppend(&result, master_id, " ");
322322

323-
absl::StrAppend(&result, "0 0 0 connected");
323+
absl::StrAppend(&result,
324+
node.health != NodeHealth::FAIL ? "0 0 0 connected" : "0 0 0 disconnected");
324325

325326
for (const auto& range : ranges) {
326327
absl::StrAppend(&result, " ", range.start);

0 commit comments

Comments
 (0)