mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-22 07:06:51 +00:00
Add ClusterReplicationMode as a distinct master-owned cluster-level replication health judgment, computed from multi-replica facts: replica LSN lag, heartbeat freshness, role state. Monotonic: worst replica state dominates. Modes: "no_replicas" (RF=1), "keepup" (all healthy), "catching_up" (replica behind but recoverable), "degraded" (stale heartbeat or barrier failure), "needs_rebuild" (unrecoverable gap or rebuilding role). Distinct from EngineProjectionMode (VS-local engine truth) and VolumeMode (legacy). They answer different questions, live in different fields, have different names. Tests explicitly prove the two can differ without conflict. Computed in recomputeReplicaState() alongside existing VolumeMode. Updated on every heartbeat that touches the entry. 9 tests: keepup, catching_up, stale degraded, LSN gap needs_rebuild, rebuilding role, no_replicas, distinctness from EngineProjectionMode, heartbeat-driven update, worst-replica-dominates (RF3). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>