diff --git a/seaweed-block/core/transport/executor.go b/seaweed-block/core/transport/executor.go index 8b53cfe91d..67b72277ed 100644 --- a/seaweed-block/core/transport/executor.go +++ b/seaweed-block/core/transport/executor.go @@ -1218,6 +1218,7 @@ func (e *BlockExecutor) finishSession(replicaID string, session *activeSession, } delete(e.sessions, session.lineage.SessionID) cb := e.onSessionClose + ackCb := e.onDurableAck e.mu.Unlock() var result adapter.SessionCloseResult @@ -1265,6 +1266,22 @@ func (e *BlockExecutor) finishSession(replicaID string, session *activeSession, } e.recordSessionTerminal(result) cb(result) + if ackCb != nil { + // 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. + _, primaryS, primaryH := e.primaryStore.Boundaries() + ackCb(adapter.DurableAckResult{ + ReplicaID: replicaID, + SessionID: session.lineage.SessionID, + DurableLSN: achieved, + PrimaryTailLSN: primaryS, + PrimaryHeadLSN: primaryH, + }) + } } func (e *BlockExecutor) recordSessionTerminal(result adapter.SessionCloseResult) {