pingqiuandClaude Opus 4.7 bf84ed4ab1 recovery: P2c-B-1 — single live path via sink.NotifyAppend (TDD)
Add NotifyAppend(lba, lsn, data) error to WalShipperSink interface.
Sender.PushLiveWrite now routes through s.sink.NotifyAppend instead
of touching liveQueue directly — the sink owns buffering / ordering
discipline.

Bridging path (senderBacklogSink) implements NotifyAppend by
buffering into the sender's liveQueue under queueMu — production
discipline (architect rule 2). streamBacklog is one-shot ScanLBAs;
direct wire emit during the scan would interleave LSNs and break
the receiver's monotonic-LSN check, so the buffer + ordered
drainAndSeal flush stays as the safety net until P2d aligns the
dual-lane wire format.

When P2d swaps in a real transport.WalShipper sink, NotifyAppend
will route to WalShipper.NotifyAppend (Backlog mode lag-tracking;
Realtime direct ship under shipMu) — at that point the queueMu /
liveQueue / drainAndSeal scaffolding can be deleted (slice B-2).

Tests:
  + TestSender_PushLiveWrite_RoutesViaSinkNotifyAppend — RED→GREEN,
    pins the routing contract (incl. error propagation from sink).
  + TestSenderBacklogSink_NotifyAppend_BuffersForDrainAndSeal — pins
    the bridging-path buffer discipline.

  recordingSink in tests gains NotifyAppend + snapshotNotifyAppend.

Verified:
  - go test ./core/recovery/ — all PASS, including 5 e2e tests
    (PushLiveWriteAtomicSeal exercises mid-session writes and
    barrier convergence end-to-end).
  - go test ./core/transport/ ./core/replication/{,component} — all PASS.

Note: dual-lane frameWALEntry vs MsgShipEntry alignment remains P2d;
backlog relay continues as the bridging sink until then.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 23:00:30 -07:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%