transport: stamp the post-close durable ack with the session's epoch and endpoint version

The engine's stale-transport guard skips zero fields, so an unstamped ack
would be taken at a new identity if the assignment moved between the
close callback and the ack. Stamp both from session.lineage, as the
review asked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-15 11:03:23 -08:00
1 parent e2f8480ec1
commit 018a670d6d
1 file changed
+12 -8
+12 -8
View File
@@ -1270,16 +1270,20 @@ func (e *BlockExecutor) finishSession(replicaID string, session *activeSession,
// As the dual-lane close does: the close proves the recovery
// window closed, and the engine publishes healthy only after
// a durable progress fact observed after it. achieved is the
// replica's barrier-acknowledged durable LSN. The ack follows
// the close, so the engine sees the window closed first. Both
// callbacks run without e.mu held.
// replica's barrier-acknowledged durable LSN. The ack carries
// the session's lineage, so the engine refuses it as stale if
// the identity moved between the two callbacks. The ack
// follows the close, so the engine sees the window closed
// first. Both callbacks run without e.mu held.
_, primaryS, primaryH := e.primaryStore.Boundaries()
ackCb(adapter.DurableAckResult{
ReplicaID: replicaID,
SessionID: session.lineage.SessionID,
DurableLSN: achieved,
PrimaryTailLSN: primaryS,
PrimaryHeadLSN: primaryH,
ReplicaID: replicaID,
SessionID: session.lineage.SessionID,
EndpointVersion: session.lineage.EndpointVersion,
TransportEpoch: session.lineage.Epoch,
DurableLSN: achieved,
PrimaryTailLSN: primaryS,
PrimaryHeadLSN: primaryH,
})
}
}