pingqiu c6bace4e79 G5-5 upstream instrumentation: observer + OnLocalWrite + ship gates
QA round 8: ALL 6 ship/dial/barrier lines from 7a3996d are missing.
The replication outer loop is not running at all. Need to walk
upstream to find where the fan-out chain breaks.

Add 4 INFO log lines at the upstream surfaces:

  durable/storage_adapter.go (writeBytes observer dispatch):
    - obs nil: 'write observer NIL — replication fan-out skipped'
      (means SetWriteObserver wasn't called before write hit)
    - obs ok: 'write observer dispatch lba=N lsn=N'

  replication/volume.go (OnLocalWrite entry):
    - 'OnLocalWrite volume=v1 lba=N lsn=N peers=K'
      (lets us see if peers map is empty even though
      UpdateReplicaSet returned ok)

  replication/peer.go (ShipEntry early-exit gates):
    - 'ship gate-close peer=r2 lba=N lsn=N (peer closed)'
    - 'ship gate-degraded peer=r2 lba=N lsn=N (peer degraded)'
      (the existing logs are AFTER these gates, so silent
      early-exit was indistinguishable from no-call)

These 4 lines + the existing 7a3996d 6 lines = 10 total. With the
next re-run we should see exactly which hop fails:

  Expected per iSCSI WRITE on primary:
    durable: write observer dispatch lba=0 lsn=1
    replication: OnLocalWrite volume=v1 lba=0 lsn=1 peers=1
    transport: ship lazy-dial replica=r2 ...
    replication: ship ok peer=r2 ...

  If 'observer NIL' appears: SetWriteObserver wiring race — observer
    not set when iSCSI starts writing.
  If OnLocalWrite shows peers=0: UpdateReplicaSet ok but peers map
    became empty (race with stale-gen replay tearing down peers?).
  If 'ship gate-close' / 'ship gate-degraded' appears: peer state
    transitioned bad before any ship attempt.
  If none of the above + ship lines silent: Backend.writeBytes itself
    is bypassed (iSCSI handler not going through StorageBackend).

Tests still green.

Refs: QA round 8 — 7a3996d logs all silent on ship path.
2026-04-27 00:59:33 -07:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%