mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
Since the engine started holding PublishHealthy until a durable ack observed after the recovery window closes, the YAML case session_closed_completed_to_healthy has failed on every run: it goes from SessionClosedCompleted straight to healthy. The schema had no way to express the ack. - schema: add the DurableAckObserved event kind (durable_lsn, primary_tail_lsn, primary_head_lsn). - cases: the healthy case now acks after the close; a new case pins that the close alone is held (publish_healthy_held, no PublishHealthy). Test-only: core/schema and core/runtime are imported only by the conformance test. Refs #94 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
292 lines
7.8 KiB
YAML
292 lines
7.8 KiB
YAML
version: v3-mini-1
|
|
|
|
cases:
|
|
- name: "catch_up_within_wal"
|
|
description: "R >= S and R < H → catch_up decision, StartCatchUp emitted"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: "10.0.0.2:9333"
|
|
ctrl_addr: "10.0.0.2:9334"
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 50
|
|
s: 10
|
|
h: 100
|
|
expect:
|
|
# Mode is degraded because StartCatchUp was emitted but no session
|
|
# started yet. Mode becomes recovering only when SessionPrepared/Started runs.
|
|
mode: degraded
|
|
recovery_decision: catch_up
|
|
must_emit_commands: [StartCatchUp]
|
|
must_not_emit_commands: [StartRebuild]
|
|
|
|
- name: "rebuild_beyond_wal"
|
|
description: "R < S → rebuild decision, StartRebuild emitted"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: "10.0.0.2:9333"
|
|
ctrl_addr: "10.0.0.2:9334"
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 5
|
|
s: 50
|
|
h: 100
|
|
expect:
|
|
mode: degraded
|
|
recovery_decision: rebuild
|
|
must_emit_commands: [StartRebuild]
|
|
must_not_emit_commands: [StartCatchUp]
|
|
|
|
- name: "caught_up_healthy"
|
|
description: "R >= H → FenceAtEpoch first; PublishHealthy only after FenceCompleted"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: "10.0.0.2:9333"
|
|
ctrl_addr: "10.0.0.2:9334"
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 100
|
|
s: 10
|
|
h: 100
|
|
- kind: FenceCompleted
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
expect:
|
|
mode: healthy
|
|
recovery_decision: none
|
|
must_emit_commands: [FenceAtEpoch, PublishHealthy]
|
|
must_not_emit_commands: [StartCatchUp, StartRebuild]
|
|
|
|
- name: "stale_epoch_rejected"
|
|
description: "Assignment with older epoch is silently rejected"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 5
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 3
|
|
endpoint_version: 1
|
|
data_addr: old
|
|
ctrl_addr: old
|
|
expect:
|
|
must_have_trace_steps: [stale_assignment]
|
|
|
|
- name: "progress_does_not_complete"
|
|
description: "Session progress to target does NOT imply completion"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 0
|
|
s: 0
|
|
h: 100
|
|
- kind: SessionPrepared
|
|
replica_id: r1
|
|
session_id: 1
|
|
session_kind: catch_up
|
|
target_lsn: 100
|
|
- kind: SessionStarted
|
|
replica_id: r1
|
|
session_id: 1
|
|
- kind: SessionProgressObserved
|
|
replica_id: r1
|
|
session_id: 1
|
|
achieved_lsn: 100
|
|
expect:
|
|
session_phase: running
|
|
must_not_emit_commands: [PublishHealthy]
|
|
|
|
- name: "session_closed_completed_holds_until_durable_ack"
|
|
description: "A completed session alone does not publish healthy: it waits for a post-close durable ack"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 0
|
|
s: 0
|
|
h: 100
|
|
- kind: SessionPrepared
|
|
replica_id: r1
|
|
session_id: 1
|
|
session_kind: catch_up
|
|
target_lsn: 100
|
|
- kind: SessionStarted
|
|
replica_id: r1
|
|
session_id: 1
|
|
- kind: SessionClosedCompleted
|
|
replica_id: r1
|
|
session_id: 1
|
|
achieved_lsn: 100
|
|
expect:
|
|
mode: recovering
|
|
session_phase: completed
|
|
must_have_trace_steps: [publish_healthy_held]
|
|
must_not_emit_commands: [PublishHealthy]
|
|
|
|
- name: "session_closed_completed_to_healthy"
|
|
description: "Full lifecycle: assign → probe → facts → session → complete → post-close durable ack → healthy"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 0
|
|
s: 0
|
|
h: 100
|
|
- kind: SessionPrepared
|
|
replica_id: r1
|
|
session_id: 1
|
|
session_kind: catch_up
|
|
target_lsn: 100
|
|
- kind: SessionStarted
|
|
replica_id: r1
|
|
session_id: 1
|
|
- kind: SessionClosedCompleted
|
|
replica_id: r1
|
|
session_id: 1
|
|
achieved_lsn: 100
|
|
# Healthy needs a durable ack after the close (the recovery
|
|
# window closing alone is held as publish_healthy_held).
|
|
- kind: DurableAckObserved
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
durable_lsn: 100
|
|
primary_head_lsn: 100
|
|
expect:
|
|
mode: healthy
|
|
recovery_decision: none
|
|
session_phase: completed
|
|
must_emit_commands: [PublishHealthy]
|
|
|
|
- name: "transport_loss_does_not_rebuild"
|
|
description: "Probe failure → degraded, NOT rebuild"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
r: 50
|
|
s: 10
|
|
h: 100
|
|
- kind: ProbeFailed
|
|
replica_id: r1
|
|
reason: connection_reset
|
|
expect:
|
|
must_emit_commands: [PublishDegraded]
|
|
must_not_emit_commands: [StartRebuild]
|
|
|
|
- name: "stale_probe_failed_old_transport_epoch_rejected"
|
|
description: "ProbeFailed from an older transport epoch is ignored"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 5
|
|
endpoint_version: 5
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: ProbeFailed
|
|
replica_id: r1
|
|
endpoint_version: 5
|
|
transport_epoch: 4
|
|
reason: stale_probe
|
|
expect:
|
|
must_have_trace_steps: [stale_probe_failed]
|
|
|
|
- name: "recovery_facts_before_probe_still_converges"
|
|
description: "Same facts in reversed order still converge to catch_up"
|
|
events:
|
|
- kind: AssignmentObserved
|
|
volume_id: vol1
|
|
replica_id: r1
|
|
epoch: 1
|
|
endpoint_version: 1
|
|
data_addr: a
|
|
ctrl_addr: b
|
|
- kind: RecoveryFactsObserved
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
r: 50
|
|
s: 10
|
|
h: 100
|
|
- kind: ProbeSucceeded
|
|
replica_id: r1
|
|
endpoint_version: 1
|
|
transport_epoch: 1
|
|
expect:
|
|
mode: degraded
|
|
recovery_decision: catch_up
|
|
must_emit_commands: [StartCatchUp]
|
|
must_not_emit_commands: [StartRebuild]
|