mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
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:
1 parent
e2f8480ec1
commit
018a670d6d
1 file changed
+12
-8
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user