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>
24 lines
946 B
Go
24 lines
946 B
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// The promotion gate reads every frontier rule from
|
|
// --launcher-replication-ack, so blockmaster refuses to start on a profile it
|
|
// does not know (as blockvolume refuses its own --replication-ack).
|
|
func TestBlockmasterRefusesAnUnknownLauncherReplicationAck(t *testing.T) {
|
|
for _, bad := range []string{"bogus", "sync_quorum", ""} {
|
|
_, err := parseFlags([]string{"--authority-store", t.TempDir(), "--launcher-replication-ack=" + bad})
|
|
if err == nil || !strings.Contains(err.Error(), "--launcher-replication-ack") {
|
|
t.Fatalf("--launcher-replication-ack=%q: err=%v; want a refusal naming the flag", bad, err)
|
|
}
|
|
}
|
|
for _, good := range []string{"best-effort", "sync-quorum", "sync-all"} {
|
|
if _, err := parseFlags([]string{"--authority-store", t.TempDir(), "--launcher-replication-ack=" + good}); err != nil {
|
|
t.Fatalf("--launcher-replication-ack=%q refused: %v", good, err)
|
|
}
|
|
}
|
|
}
|