dragonflydb / dragonflydb/dragonfly
Reject cluster configurations that conflict with runtime replication role
- Dominant language
- C++
- Stars
- 31.5k
- Forks
- 1.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 121
Description
## Problem
Cluster `replicas[]` is descriptive and independent of `REPLICAOF`. Configuration installation
does not verify that a node declared as a replica is currently replicating from its configured
master.
A declared replica receives ownership of its master's slots for read routing. If its runtime
`is_master` state remains true, for example because startup commands were applied in the wrong
order, it can accept direct writes and diverge from the actual master.
The out-of-band role relationship is documented, but accepting contradictory runtime and topology
state still deserves dedicated tracking.
## References
https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/docs/cluster-mode.md#L92-L104
https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/src/server/cluster/cluster_config.cc#L157-L166
https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/src/server/cluster/cluster_family.cc#L540-L551
https://github.com/dragonflydb/dragonfly/blob/980c70331d194d7133079917668fec269444c65c/src/server/main_service.cc#L1411-L1417
Contributor guide
Research direction
Read the cluster topology and startup flow in src/server/cluster/cluster_config.cc, src/server/cluster/cluster_family.cc, and src/server/main_service.cc, using the referenced line ranges as entry points. Compare the documented replicas[] relationship with the runtime REPLICAOF and is_master state. Done means installation rejects contradictory cluster and runtime replication roles, with focused coverage for the conflicting configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100