mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-12 14:58:44 +01:00
refactor: make bounded recovery observation events replica-scoped
Carry replica-scoped addressing through bounded recovery planning and completion events so the core no longer depends on a volume-only observation seam. This preserves the current single-replica catch-up and rebuilding behavior while aligning the observation side with the replica-scoped command path. Made-with: Cursor
This commit is contained in:
1 parent
b304b8e212
commit
16ba70f856
9 files changed
+174
-40
No files matched your search
@@ -13,7 +13,7 @@ type RebuildCompletionStatus struct {
|
||||
// DeriveRebuildCommitted computes the RebuildCommitted event from
|
||||
// post-rebuild status and the original plan. This is the reusable
|
||||
// shaping logic — the host only needs to supply the raw snapshot values.
|
||||
func DeriveRebuildCommitted(volumeID string, status RebuildCompletionStatus, plan *engine.RecoveryPlan) engine.RebuildCommitted {
|
||||
func DeriveRebuildCommitted(volumeID, replicaID string, status RebuildCompletionStatus, plan *engine.RecoveryPlan) engine.RebuildCommitted {
|
||||
flushedLSN := status.CommittedLSN
|
||||
if flushedLSN == 0 {
|
||||
flushedLSN = plan.RebuildTargetLSN
|
||||
@@ -27,6 +27,7 @@ func DeriveRebuildCommitted(volumeID string, status RebuildCompletionStatus, pla
|
||||
achievedLSN = checkpointLSN
|
||||
}
|
||||
return engine.RebuildCommitted{
|
||||
ReplicaID: replicaID,
|
||||
ID: volumeID,
|
||||
AchievedLSN: achievedLSN,
|
||||
FlushedLSN: flushedLSN,
|
||||
|
||||
Reference in new issue
Block a user