Commit Graph
3468 Commits
Author SHA1 Message Date
pingqiu d0d66bfc6e test: forbid provider opens for invalid Target writes 2026-11-16 00:52:49 -08:00
pingqiu 5256583bfc test: benchmark actual Target provider path against main 2026-11-16 00:43:23 -08:00
pingqiu 2b079007bd fix: forward durable timing through production ublk provider 2026-11-16 00:41:47 -08:00
pingqiu 6c54d88834 test: open storage before recovering Target fixture 2026-11-16 00:40:50 -08:00
pingqiu bd73350e9c test: reproduce missing latency through actual ublk Target 2026-11-16 00:40:37 -08:00
pingqiuandClaude Opus 5.5 c5f619c9dd storage: #159 controls: batch reuse bound, Recover bounds persist failure
codex01's #159 P2-S2 and P2-S3 (tests only):

- TestWALWriterBatchReuseIsBoundedByTheDurableTail: the batch planner,
  with a padding wrap, is refused while a release is in memory only or the
  recovered bounds are pending (no head move, no padding written), and
  accepted once the tail is persisted.
- TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry: a
  failing superblock write or fsync fails Recover and admits no Write; a
  same-instance Recover retry persists the bounds; a later Write, Sync and
  reopen keep the exact bytes.

Mutation controls (WSL): reverting only the batch planner's durable-tail
check fails the batch test alone; publishing the tail before Recover's
persist, or dropping the pending flag, fails its own control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:29:54 -08:00
pingqiu 3c3274bd7d test: use concrete durable backend in proxy workload 2026-11-16 00:27:55 -08:00
pingqiu eeccf823cc test: exercise chunk status and whole fsync-heavy workload 2026-11-16 00:27:36 -08:00
pingqiu d42e123a89 docs: explain durable latency populations and fsync diagnosis 2026-11-16 00:24:25 -08:00
pingqiu cb17180f10 test: distinguish append attempts and per-waiter queue latency 2026-11-16 00:23:07 -08:00
pingqiu 82a87ca2d6 test: cover histogram stages, frontend counts and failed syncs 2026-11-16 00:22:02 -08:00
pingqiu a8aabd71b1 feat: expose bounded durable I/O latency histograms 2026-11-16 00:20:28 -08:00
pingqiu d71abccf6c test: require durability latency histograms in existing status 2026-11-16 00:18:52 -08:00
pingqiuandClaude Opus 5.5 4ffa3c9a08 storage: frontier-gap guard reads the superblock without opening a store
codex01's AMEND on 980de2b9 (tests-only P2): the helper opened a full
WALStore and only stopped its committer and closed its fd, leaving the
flusher and ticker alive. Read the superblock with a scoped file read
(readSuperblock), and register the original store's cleanup right after
open so a Fatal before the crash step still closes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:17:08 -08:00
pingqiuandClaude Opus 5.5 980de2b94a storage: guard: recovery keeps synced entries above an unpersisted frontier jump
claude05's condition (1) for any prefix-cut recovery rule (2026-11-16
07:33Z). A rebuild installs BASE by WriteExtentDirect (no LSN) and applies
WAL-lane entries with their real LSNs by ApplyEntry; AdvanceFrontier runs
only at MarkBaseComplete and is in memory until a Sync. So a store can hold
synced LSN 101-102 with a persisted checkpoint of 0 and no LSN 1..100.
Recovery keeps them; a rule replaying only the contiguous LSN prefix above
the checkpoint would keep none. This pins that, so no such rule lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:09:55 -08:00
pingqiu f99663a69a fix: separate workspace lease expiry with a clock skew margin 2026-11-15 23:53:02 -08:00
pingqiuandClaude Opus 5.5 7184c0f2e3 storage: scan an empty superblock window from its position
A full checkpoint persists head == tail (88fbb345 persists the released
tail). Sync does not persist the head, so appends after it continue
contiguously from that position; recovery now scans [pos, end) then
[0, pos) from it. The footer high-run search stays only for the legacy
(0, 0) superblock. Scanning from offset 0 let a torn unsynced record
wrapped there hide every synced record after it.

Model check (claude05's WALRecovery.tla, rule rootLww = this writer and
scan plus #156's replay by LSN, K=4, 4 LSNs): crash-only I1 and I2 hold
(247,395 distinct states).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:48:02 -08:00
pingqiuandClaude Opus 5.5 46546f20d3 storage: RED: a full flush's head==tail sends recovery to offset 0
With the released tail persisted (88fbb345), a full flush persists
head == tail. Sync does not persist the head, so synced appends follow it;
recovery's head==tail path ignores the persisted position and scans from
offset 0 when no high run is found, so a torn unsynced record wrapped to 0
hides every synced record after it (claude05's S3 trace shape).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:45:32 -08:00
pingqiuandClaude Opus 5.5 88fbb345b0 storage: reuse only WAL bytes the persisted tail released
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z), root
fix: the WAL writer may only overwrite bytes released by the PERSISTED
superblock tail, so a torn new record can never land inside the persisted
[tail, head) and hide a synced record behind it (crash only, no
corruption).

- walWriter.durableTail: the tail of the last fsynced superblock. The
  space checks (append, appendBatch planning, admission pressure) count
  from it; a release made only in memory frees nothing. Bounds rebuilt by
  recovery are not reusable until persisted.
- The flusher's checkpoint persists the tail it releases (the old code
  persisted the pre-advance tail and advanced after), with head and tail
  taken from one writer snapshot. A flush whose checkpoint is already
  covered (direct frontier) still persists its tail release.
- Recover persists the rebuilt head/tail before any append when they
  differ from the on-disk superblock.

The replay-side defense (resync past a bad entry, replay by LSN up to
the first gap) is #156.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:39:27 -08:00
pingqiuandClaude Opus 5.5 99e281d153 storage: RED: the WAL writer reuses bytes the persisted tail retains
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z): the
writer may only overwrite bytes that the PERSISTED superblock tail has
released. On main the flusher persists the pre-advance tail and the
in-memory tail moves after it, and Recover moves the writer's bounds
without persisting them, so a torn new record can land inside the
persisted [tail, head) and hide a synced record behind it.

- flusher.afterSnapshotForTest: a test-only hook in the window after the
  dirty-map snapshot (an append there is covered by the persisted head
  but not by the checkpoint).
- TestWALStoreAppendDuringFlushThenTornWrapKeepsSyncedRecords: the S3
  trace, deterministic; crash only; synced LSN 2 is lost on main.
- TestWALStoreFlushPersistsTheReleasedTail, TestWALStoreRecoverPersists-
  TheRecoveredBounds: the on-disk tail lags the writer's.
- TestWALWriterReuseIsBoundedByTheDurableTail: an in-memory release
  makes its bytes reusable at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:37:14 -08:00
pingqiu dae0bb9072 test: seed skew controls through authority publication 2026-11-15 23:32:51 -08:00
pingqiu 342dc3529a fix: separate workspace lease expiry with a clock skew margin 2026-11-15 23:30:05 -08:00
pingqiu edb80c9efd Merge main 11f3afe6 into fix/walstore-recovery-lww 2026-11-15 23:17:50 -08:00
pingqiu 1bad5dccec Merge main 11f3afe6 into fix/issue51-walstore-midhistory 2026-11-15 23:17:47 -08:00
Ping Qiu 11f3afe6df Merge pull request #154 from seaweedfs/fix/nvme-rdma-backend-reopen-87
fix: reopen stale NVMe RDMA backends after failover
2026-11-15 23:16:19 -08:00
Ping Qiu 5a9121f762 Merge pull request #153 from seaweedfs/fix/rf1-replication-ingress
fix: gate replication listeners on assigned replica slots
2026-11-15 23:16:10 -08:00
Ping Qiu 0e25feaacc Merge pull request #152 from seaweedfs/feat/volume-delete
chunkstore: volume delete (ops chunk volume-delete)
2026-11-15 23:16:00 -08:00
pingqiuandClaude Opus 5.5 d87c49d9d4 storage: WAL holes are detection only (#51, ruling A)
claude05's ruling (A), 2026-11-16 06:47Z: nothing about which records
replay, where replay stops, or whether the volume opens changes.

- walstore: recovery.go is main's replay again; the checkpoint+1
  cutoff and the cross-range stop are gone. At a non-zero bad entry a
  look-ahead finds whether a valid later entry (LSN above the highest
  decoded so far) follows in the rest of its range or a later one; if
  so the typed warning wal_hole_suspected is logged and counted. A
  look-ahead read error is logged and changes nothing.
- smartwal: the positional mid-history fail-closed is gone (no
  generation guessing). Populated slots whose record CRC fails are
  skipped as before and reported as the counted warning (a torn tail
  or a corrupted record; not distinguishable without a watermark).
  ea1faf6a's data-CRC fail-closed stays as merged.
- the warning still reaches the durable status and /status and never
  changes Healthy, readiness or promotion.

Cross-range detection, no replay past a hole, and any new fail-closed
move to the post-M4 watermark work. Last-writer-wins by LSN is #156.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:04:21 -08:00
pingqiuandClaude Opus 5.5 e910449f70 storage: RED controls for the #155 review (detection only)
codex01's review of f8d43653 (V:/share/rdma/codex01-block155-review-
20261116T0644Z/REVIEW.md) and claude05's ruling (A), 06:47Z. Against the
reviewed production code (its replay cutoff and positional smartwal
fail-closed; smartwal warning accessors stubbed so the tests build):

- a damaged STALE record in a released range drops retained, synced
  LSN 3 (TestWALStoreRecoverStaleReleasedGarbageKeepsRetainedData);
- a torn smartwal slot accepted by one recovery becomes wal_corrupt
  after a frontier jump and a new sync
  (TestSmartWALTornSlotSurvivesAFrontierJump);
- a smartwal mid-history hole is an outage instead of a warning
  (TestDurableStartup_Issue51_SmartWALHoleIsAWarningNotAnOutage);
- plus codex01's advisory: a healthy primary stays healthy with a
  warning (TestStatusServer_StatusCarriesRecoveryWarnings..., which
  passes either way: the plumbing never forced health).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:04:18 -08:00
pingqiuandClaude Opus 5.5 ca42d76812 storage: walstore recovery is last-writer-wins by LSN
claude05's ruling (B), 2026-11-16 06:47Z. Recovery replay now uses
dirtyMap.putAtIfNewer: an entry replaces an LBA's dirty-map entry only
when its LSN is higher. Range scan order is physical, and a persisted
head/tail can predate a wrap, so a newer version can be scanned before
an older one. This changes only the order in which the replayed entries
take effect, never which entries are replayed; the runtime write paths
keep putAt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:55:13 -08:00
pingqiuandClaude Opus 5.5 67998e5df6 storage: RED control: walstore recovery replays an older version over a newer one
claude05's ruling (B), 2026-11-16 06:47Z. On main, recovery applies
entries to the dirty map in physical range-scan order and putAt
replaces unconditionally. When the persisted head/tail predate a wrap,
the range scanned first can hold the newer version of an LBA and a
later range the older one: the older version wins, silently.
TestWALStoreRecoverLastWriterWinsAcrossScanOrder: LBA 20 written at the
high end (LSN 4), then rewritten by a batch that wraps to offset 0
(LSN 5); after recovery LBA 20 reads the LSN 4 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:49:45 -08:00
pingqiu 66163442fe fix: reopen RDMA backend after a stale lineage refusal 2026-11-15 22:35:48 -08:00
pingqiuandClaude Opus 5.5 f8d43653a7 storage: detect WAL holes; walstore warns, smartwal fails closed
Issue #51, claude05's rulings (2026-11-16 06:10Z, 06:14Z).

walstore (interim; no fail-closed: a plain power loss must never become
an outage):
- recovery decodes every range first and replays by LSN, not by scan
  order (a persisted head/tail can predate a wrap). A non-zero bad entry
  bounds the replay: its LSN is above its circular predecessor's, so
  nothing at or above that bound is replayed in any range.
- a bad entry followed by any valid later entry is a suspected hole:
  logged, counted (HolesSuspected) and reported as the typed warning
  wal_hole_suspected (WALStore.RecoveryWarnings), surfaced in the
  durable status and on /status without changing Healthy or readiness.
- trailing zeros still just end a range; a torn tail recovers silently.

smartwal: a corrupted committed slot (magic present, record CRC bad)
behind the highest valid LSN's slot is a mid-history hole: WAL
integrity failure (wal_corrupt). The slot right after it is the torn-
tail position and still recovers.

The durable synced watermark that tells a corrupted synced record from
an unsynced torn one is the post-M4 format change, not this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:29:48 -08:00
pingqiuandClaude Opus 5.5 d2a6a3b02c storage: RED controls for issue #51 (WAL holes)
claude05's rulings (2026-11-16 06:10Z, 06:14Z). Controls with real
corrupted WALs, failing against stubs that restore today's behaviour:

walstore (interim: a power loss must never become an outage):
- (a) a corrupted mid-history synced entry: recovery succeeds to the
  prefix, but no wal_hole_suspected warning, no count
  (TestWALStoreRecoverWarnsOnMidHistoryHole);
- (c) the newer batch wrapped to offset 0 is replayed past a corrupted
  older entry (TestWALStoreRecoverNoReplayPastAHoleAcrossWrappedRanges);
- the durable status and /status carry no warning
  (TestDurableStartup_Issue51_WALStoreHoleIsAWarningNotAnOutage,
  TestStatusServer_StatusCarriesRecoveryWarningsWithoutChangingHealth).
- controls that pass either way: (b) an out-of-order unsynced tail
  recovers, a torn tail recovers.

smartwal (fail closed on a mid-history hole):
- a corrupted committed slot with later valid records starts Ready
  (TestDurableStartup_Issue51_SmartWALMidHistoryHoleIsWALCorrupt);
- controls: the issue's exact mutation is wal_corrupt (ea1faf6a), a
  torn tail recovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:29:41 -08:00
pingqiu f5b1523b8a fix: reopen RDMA backend after a stale lineage refusal 2026-11-15 22:27:14 -08:00
pingqiu 919163c11f fix: reopen RDMA backend after a stale lineage refusal 2026-11-15 22:12:52 -08:00
pingqiu 469edccd04 test: qualify replication exchanges and admitted-operation withdrawal 2026-11-15 22:02:36 -08:00
pingqiu 79b3ee78d5 test: qualify replication exchanges and admitted-operation withdrawal 2026-11-15 21:50:32 -08:00
pingqiu 243f73633f fix: gate replication listeners on assigned replica slots 2026-11-15 21:29:56 -08:00
pingqiuandClaude Opus 5.5 41f00e5b1a volume delete: terminal-state fork replay; reservation-aware import
- Fork's early replay of a completed request refuses (volume_deleted)
  a target whose HEAD is deleting, purging or deleted, also before its
  VOLUME is marked, like the later publication path.
- Host.ImportLifecycleVolume registers a cluster-spec volume under the
  CreateVolume RPC's boundary (workspaceMu, reservation check through
  the create); blockmaster startup uses it, skipping (and logging) a
  reserved id, and the placement import skips reserved ids too.
  Unreserved ids keep importing idempotently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:06:24 -08:00
pingqiuandClaude Opus 5.5 a60daf2376 volume delete: RED controls for the r4 P2s
codex01's r4 review (V:/share/rdma/codex01-block152-r4-review-
20261116T0445Z/REVIEW.md). Controls failing against stubs:

- Fork's early replay reports success for a target past the delete mark
  (deleting, purging, HEAD deleted before VOLUME is marked)
  (TestCatalog_ForkReplayRefusesADeletingTarget);
- the cluster-spec import re-creates and places a reserved id after a
  restart with the original spec (TestClusterSpecImportSkipsAReserved
  Volume).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:06:23 -08:00
pingqiuandClaude Opus 5.5 4ac23effec Merge origin/main (139d649) into feat/volume-delete
No conflicts (#147-#151; no proto change on main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:32:58 -08:00
Ping Qiu 139d649ddf Merge pull request #151 from seaweedfs/feat/parallel-segment-manifests
Parallelize chunk uploads and publish immutable manifest segments
2026-11-15 20:30:17 -08:00
Ping Qiu dced8bdc79 Merge pull request #150 from seaweedfs/feat/block-metadata-hooks
Add neutral optional per-block metadata hooks to WALStore
2026-11-15 20:30:08 -08:00
Ping Qiu d52230ce57 Merge pull request #149 from seaweedfs/fix/cluster-spec-volume-registration
fix: register desired volumes from complete cluster specifications
2026-11-15 20:29:58 -08:00
Ping Qiu 72e12c67ba Merge pull request #148 from seaweedfs/test/gc-fixture-live-volume
test: register GC integration volume before authority publication
2026-11-15 20:29:49 -08:00
Ping Qiu 39b59b6579 Merge pull request #147 from seaweedfs/test/c2-dense-lsn-flake-claude04
transport: make the C2 dense-LSN edge test deterministic
2026-11-15 20:29:38 -08:00
pingqiuandClaude Opus 5.5 9f82dcd48a volume delete: no snapshot cascade; incarnation-bound commit
claude05's cut (04:08Z): volume-delete refuses with
volume_has_snapshots while the volume has any snapshot name record (a
published snapshot, one being deleted, or an attempt in flight); the
operator deletes snapshots first. The delete never touches snapshot
names, attempts or roots: the snapshot loop, the claim check and claim
release (a claim lives on a named snapshot; a deleted target's claim is
dead by rule), and CreateSnapshot's back-out are gone. CreateSnapshot
and Fork still refuse once they see the delete mark.

codex01's r3 P2s:
- the snapshot check, the revert and the commit are bound to one
  deleting incarnation (its generation); if HEAD moved, the check runs
  again on the incarnation found;
- the CLI's admission token is --request-id (required), so a rerun
  adopts and can give back an earlier invocation's hold;
- CreateVolume holds workspaceMu through the create;
- the reservation store syncs its parent directory before use (the
  binding store's helper).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:27:44 -08:00
pingqiuandClaude Opus 5.5 425161bbe3 volume delete: RED controls for the cut and the r3 P2s
claude05's 04:08Z cut (no snapshot cascade) and codex01's r3 P2s
(V:/share/rdma/codex01-block152-r3-review-20261116T0405Z/REVIEW.md).
Controls failing against stubs:

- the cut: a volume with a snapshot, an in-flight snapshot attempt, or
  a fork's snapshot is deleted (TestCatalog_DeleteVolumeRefusesWhile
  SnapshotsExist, TestCatalog_InFlightSnapshotRefusesTheDelete, ...Fork
  DuringTheDeleteMarkRefuses, ...TombstonesAndRefusesReuse);
- incarnation: a claim check under generation G commits a re-marked G'
  (TestCatalog_DeleteCommitIsBoundToItsIncarnation);
- lost CLI token: a rerun cannot release the earlier hold
  (TestOpsChunk_VolumeDelete, real master, restart);
- CreateVolume drops workspaceMu before the create
  (TestMarkVolumeDeleting_CreateHoldsTheReservationLock);
- the reservation directory's parent is not synced
  (TestDeletionReservations_ParentSyncBeforeUse).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:27:44 -08:00
pingqiuandClaude Opus 5.5 2e078746ee volume delete: durable master reservation, commit point, settled abort
- Master: a deletion reservation store (core/lifecycle), separate from
  the desired-volume records, so an unknown id is reserved too and the
  ordinary DeleteVolume/CreateVolume path cannot clear it. Held by
  per-delete tokens (admitted), permanent once committed. Writes reuse
  the binding store's crash-safe pattern (synced temp file, atomic
  rename, synced directory); an unknown outcome keeps a protective
  change in memory (fail closed). MarkVolumeDeleting records it under
  RecordWorkspaceDeletion's check; new AbortVolumeDeleting and
  CommitVolumeDeleting. Every gate (publication admission, reconciler,
  workload planner, binding/placement/move, CreateVolume) consults it.
  VolumeRecord.Deleting is gone.
- Catalog: Admission is Admit/Commit/Abort; ErrNotAdmitted marks a
  definite refusal, anything else is an unknown outcome
  (admissionUncertain). Every give-back aborts this delete's admission.
  A commit point (HEAD deleting -> purging, conditioned on the HEAD
  read) precedes the irreversible steps; a revert races on the same
  write, so a delete that sampled a claim cannot undo another delete's
  commit, and reports an error instead of a give-back.
- CreateSnapshot's back-out settles its name like the delete does: the
  name is freed only after the attempt's tombstone or winning
  publication is confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:54:32 -08:00