Status loses automatic-exit state when copying joint configurations

perfloop-oss/raft · Uncatalogued correctness

https://perfloop.ai/t/oss/case_0my6d8gj1j

Verdict

VERIFIED · settled 2026-11-10 · pull request opened as etcd-io/raft#552

What happened: The check fails before this change and passes with it.

Hypothesis

Full status reports a manual joint transition even when Raft is configured to leave it automatically. This misstates the group configuration exposed to status callers. Consumer reliance and production occurrence remain unmeasured; this finding does not establish a consensus stall.

RawNode.Status calls getStatus, which assigns r.trk.Config.Clone(). Clone returns a Config literal containing Voters, Learners and LearnersNext but omits AutoLeave. The returned flag is therefore false, including when the active joint configuration has AutoLeave=true. Config documents that this flag distinguishes automatic from application-initiated exit. False-valued inputs do not exhibit this field mismatch.

The retained checkProperty(prop_zbtf71njb5) replay failed at revision c51f010c851edd0dada5af41bafbf68e54617767 using `go test . -run '^TestPerfloopStatusConfigFidelity$' -count=1 -timeout=60s`. It initializes a one-voter follower with consistent persisted snapshot and hard-state term 1. A default-auto ApplyConfChange adds voter 2 and demotes voter 1. The active configuration becomes voters=(2)&&(1), learners_next=(1), AutoLeave=true, while Status.Config has the same sets and AutoLeave=false. The deterministic input is stored in testdata/perfloop_status_config/fidelity_replay.json on the property node. The search stopped at this mismatch; it did not complete its declared 15-input matrix.

The smallest Case check is to rerun that stored replay before and after the repair. The independent proof target is complete configuration fidelity through Status and Clone, with both true and false flags, simple and joint states, and exit from joint state. The full bounded matrix should pass after repair. Nil-map preservation and two-way map isolation are separate regression properties, not evidence of a performance saving.

The upstream implementation comparison remains distinct. PR #285 (https://github.com/etcd-io/raft/pull/285), refreshed before submission at head aa1073bb101b9cc22b035a0d9a9c0019dbbb6ecd, renames the voter halves but still omits AutoLeave from Clone. Draft #168 (https://github.com/etcd-io/raft/pull/168) adds witness fields and also leaves this omission. PR #547 (https://github.com/etcd-io/raft/pull/547), linked to issue #545, fixes storage locking and protobuf aliasing rather than tracker.Config field fidelity. No customer closure reasons were returned, and focused prior-repair searches found no matching repair.

Change to test: Preserve the complete configuration value while keeping every voter and learner map independently owned. Starting from a value copy and then replacing the mutable maps would avoid silently defaulting omitted scalar fields without changing the public API.

Where it lives

perfloop-oss/raft · rawnode.go

Evidence

The check fails before this change and passes with it: `Config.Clone and RawNode.Status preserve all configuration fields, including AutoLeave, in a bounded matrix of 15 transition sequences covering auto, implicit and explicit modes, simple and joint states, and joint exit; nil and empty maps retain their representation and all four maps are independently owned.`

Checks: 5 of 5 passed. Verification: no defect found.

Timeline