dragonflydb / dragonflydb/dragonfly

Reject invalid cluster node health values instead of defaulting to online

Closed Beginner friendly
#8,233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
31.6k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
137

Description

## Problem

`ClusterExtendedNodeInfo::health` defaults to `ONLINE`. When `health` is not a string or contains
an unknown value, `ParseClusterNode` logs an error but still returns the node.

For example, `"health": "faill"` is accepted as `ONLINE`. The replica may consequently appear in
`CLUSTER SLOTS` as a healthy read target.

## References

https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/src/server/cluster/cluster_defs.h#L108-L116

https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/src/server/cluster/cluster_config.cc#L260-L282

https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/docs/cluster-node-health.md#L34-L48

Contributor guide

Open the contributing guide

Research direction

Start with ParseClusterNode in src/server/cluster/cluster_config.cc and compare its handling with ClusterExtendedNodeInfo::health in src/server/cluster/cluster_defs.h. Check the documented health values in docs/cluster-node-health.md. Done means non-string or unknown health values are rejected instead of producing an online node, while valid values retain their documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.