mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
G5-5 upstream instrumentation: observer + OnLocalWrite + ship gates
QA round 8: ALL 6 ship/dial/barrier lines from7a3996dare 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 existing7a3996d6 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 —7a3996dlogs all silent on ship path.
This commit is contained in:
1 parent
7a3996d2b0
commit
c6bace4e79
3 files changed
+19
-1
No files matched your search
@@ -379,7 +379,16 @@ func (b *StorageBackend) writeBytes(ctx context.Context, offset int64, p []byte)
|
||||
b.mu.Lock()
|
||||
obs := b.observer
|
||||
b.mu.Unlock()
|
||||
if obs != nil {
|
||||
// G5-5 instrumentation: log every write hit to the observer
|
||||
// hook so we can disambiguate "WriteObserver never wired" from
|
||||
// "wired but fan-out fails downstream". obs==nil at write time
|
||||
// indicates SetWriteObserver wasn't called BEFORE the iSCSI
|
||||
// initiator started writing — a timing race in main.go.
|
||||
if obs == nil {
|
||||
log.Printf("durable: write observer NIL — replication fan-out skipped (lba=%d lsn=%d) — SetWriteObserver not yet wired",
|
||||
lba, lsn)
|
||||
} else {
|
||||
log.Printf("durable: write observer dispatch lba=%d lsn=%d", lba, lsn)
|
||||
if werr := obs.Observe(ctx, lba, lsn, block); werr != nil {
|
||||
log.Printf("durable: replication fan-out failed lba=%d lsn=%d: %v",
|
||||
lba, lsn, werr)
|
||||
|
||||
@@ -187,10 +187,14 @@ func (p *ReplicaPeer) ShipEntry(ctx context.Context, lineage transport.RecoveryL
|
||||
p.mu.Lock()
|
||||
if p.closed {
|
||||
p.mu.Unlock()
|
||||
log.Printf("replication: ship gate-close peer=%s lba=%d lsn=%d (peer closed)",
|
||||
p.target.ReplicaID, lba, lsn)
|
||||
return fmt.Errorf("replication: ShipEntry: peer %s closed", p.target.ReplicaID)
|
||||
}
|
||||
if p.state == ReplicaDegraded {
|
||||
p.mu.Unlock()
|
||||
log.Printf("replication: ship gate-degraded peer=%s lba=%d lsn=%d (peer degraded)",
|
||||
p.target.ReplicaID, lba, lsn)
|
||||
return fmt.Errorf("replication: ShipEntry: peer %s degraded", p.target.ReplicaID)
|
||||
}
|
||||
peerLineage := p.lineage
|
||||
|
||||
@@ -336,6 +336,11 @@ func (v *ReplicationVolume) OnLocalWrite(ctx context.Context, w LocalWrite) erro
|
||||
if v.closed {
|
||||
return fmt.Errorf("replication: OnLocalWrite: volume %s closed", v.volumeID)
|
||||
}
|
||||
// G5-5 instrumentation: log entry with peer count so we can
|
||||
// disambiguate "OnLocalWrite never called" vs "called but
|
||||
// peers map is empty" vs "called and fans out".
|
||||
log.Printf("replication: OnLocalWrite volume=%s lba=%d lsn=%d peers=%d",
|
||||
v.volumeID, w.LBA, w.LSN, len(v.peers))
|
||||
|
||||
// Fan out under the mutex — LSN-order invariant (Condition A).
|
||||
// Lineage is informational; each peer uses its own registered
|
||||
|
||||
Reference in new issue
Block a user