mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 19:17:28 +01:00
The gate reads every frontier rule from blockmaster's --launcher-replication-ack, but a volume runs its own --replication-ack. Adds the wire field (ProbeAnswer.ack_profile) and the result fields, with tests: both gates hold, without fencing, when an answer's profile is missing or differs from the master's, or the master's is unknown; the probe round names the mismatch; the volume answers its own profile; blockmaster refuses an unknown --launcher-replication-ack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
558 B
Go
15 lines
558 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
// The volume answers every promotion probe with its own --replication-ack,
|
|
// in the canonical form the master compares (best_effort, sync_quorum,
|
|
// sync_all).
|
|
func TestHostConfigAnswersTheVolumesOwnAckProfile(t *testing.T) {
|
|
for flag, want := range map[string]string{"best-effort": "best_effort", "sync-quorum": "sync_quorum", "sync-all": "sync_all"} {
|
|
if got := hostConfig(flags{replicationAck: flag}, nil).AckProfile; got != want {
|
|
t.Fatalf("--replication-ack=%s: AckProfile %q; want %q", flag, got, want)
|
|
}
|
|
}
|
|
}
|