From d7c6f8aca31f9a8d516c5e42facbbf3b7412e718 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 28 Apr 2026 01:56:19 -0700 Subject: [PATCH] G6 #1: rebuild-START log marker for QA observability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per G6 §1.H audit work envelope item #1 + §2 #5 acceptance: StartRebuild fires the wire-level rebuild path asynchronously (goroutine launched at line 31 in rebuild_sender.go); pre-G6 the only log marker was 'executor: rebuild complete, sent N blocks' which fires AFTER completion. QA's G5-5C scenario D 5s scrape window saw nothing because rebuild execution exceeded the window — there was no START marker to wait on. Add a deterministic START marker BEFORE the goroutine spawns: executor: rebuild start replica= sessionID= epoch= EV= targetLSN= Fixed string shape so QA's wait_until_rebuild_dispatched helper can grep deterministically. Includes lineage tuple for forensics (matches existing engine StartRebuild command shape; future multi-session debugging can correlate START → COMPLETE on sessionID). Pinned by: INV-G6-WALRECYCLE-DISPATCHES-REBUILD (load-bearing hardware pin §2 #5). Test results: full ./core/transport/ + ./core/engine/ regression GREEN. No behavioral change — pure observability addition. --- seaweed-block/core/transport/rebuild_sender.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/seaweed-block/core/transport/rebuild_sender.go b/seaweed-block/core/transport/rebuild_sender.go index c0ac842e61..f7184618d7 100644 --- a/seaweed-block/core/transport/rebuild_sender.go +++ b/seaweed-block/core/transport/rebuild_sender.go @@ -28,6 +28,19 @@ func (e *BlockExecutor) StartRebuild(replicaID string, sessionID, epoch, endpoin return err } + // G6 §2 #5 observability: emit a deterministic START marker BEFORE + // the goroutine spawns so QA's wait_until_rebuild_dispatched + // helper has a fixed log string to scrape against — independent + // of how long the actual rebuild takes on the wire (the + // pre-existing "executor: rebuild complete" line only fires + // AFTER completion, which the G5-5C scenario D 5s scrape window + // missed for sustained-write workloads). + // + // Pinned by: INV-G6-WALRECYCLE-DISPATCHES-REBUILD (test pointer) + // + QA `wait_until_rebuild_dispatched` helper (D-scenario harness). + log.Printf("executor: rebuild start replica=%s sessionID=%d epoch=%d EV=%d targetLSN=%d", + replicaID, sessionID, epoch, endpointVersion, targetLSN) + go func() { achieved, err := e.doRebuild(replicaID, session, targetLSN) e.finishSession(replicaID, session, achieved, err)