Commit Graph
1484 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 bc5e3e6446 storage: P2 review fold: Lock-request handshake, bounded test helper, design wording
- A test-only hook right before the capture barrier's Lock request; the
  pause tests hold the barrier shared for 300 ms after that handshake (not
  after admission plus a sleep), so the cut provably waited at its Lock and
  pre-barrier time is excluded.
- The helper releases the shared hold on every path (also on a failed
  assertion) and joins the cut within a bound.
- Design docs: barrierPauseNs runs from the Lock request and includes
  lockWaitNs.

Mutants (declared, 4/4): pause timed after the Lock, lock wait unset, body
drops the field, the hook fired after the Lock (no handshake).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 20:22:30 -08:00
pingqiuandClaude Opus 5.5 9302f31e48 storage: cut barrier pause counts the lock wait; report LockWaitNs (#216 follow-up P2)
BarrierPauseNs started after captureMu.Lock returned, so the wait for
writers already holding the capture barrier shared (e.g. parked in WAL
admission) was not counted, although a pending Lock already blocks new
writers: the reported guest pause understated it.

The pause is now timed from the Lock request, and LockWaitNs reports the
wait for the shared holders on its own (also in the /chunk/cut body).

Tests: a cut whose barrier is held shared for 300 ms reports a pause that
includes the wait (red on main: about 24 ms) and a LockWaitNs of about the
hold, inside the pause before the sync. Three declared mutants (pause timed
after the Lock, lock wait unset, body drops the field) each turn exactly
their declared tests red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 19:47:49 -08:00
Ping Qiu b6ca5237fd Merge pull request #216 from seaweedfs/feat/cut-cow-native
storage: move native chunk cut copying outside the write barrier
2026-11-18 19:16:05 -08:00
Ping Qiu 82f06ed7be Merge pull request #220 from seaweedfs/test/admission-waiter-inventory-followup
test: synchronize admission waiters and clarify replacement coverage
2026-11-18 18:04:30 -08:00
pingqiu 77b96d025d test: synchronize existing admission waiters and mark partial v3 replacement coverage 2026-11-18 17:35:32 -08:00
pingqiu 761882ba82 Merge native WAL admission fixes into COW cut branch 2026-11-18 17:13:37 -08:00
Ping Qiu 4106501a50 Merge pull request #219 from seaweedfs/fix/wal-pressure-terminal-fault
fix: preserve terminal WAL admission faults and strengthen burst readback
2026-11-18 16:51:32 -08:00
pingqiu b88c64cd15 docs: identify the burst caller and pattern controls separately 2026-11-18 16:25:55 -08:00
pingqiu 34a8246970 test: cover terminal fault propagation through a saturated writer gate 2026-11-18 16:24:31 -08:00
pingqiu dffda03239 fix: preserve terminal faults in WAL pressure waits and bind burst bytes to full LBA 2026-11-18 16:23:35 -08:00
pingqiu 1ae48b7939 test: expose terminal fault wait and burst pattern lap alias 2026-11-18 16:22:28 -08:00
Ping Qiu 7e7610e2de Merge pull request #217 from seaweedfs/fix/walstore-v3-admission
fix: honor native v3 WAL pressure and log Flush failures
2026-11-18 16:15:15 -08:00
pingqiu 0ff432fbe9 docs: pin native tail reuse controls in the liveness audit 2026-11-18 16:02:47 -08:00
pingqiu cd5d7db0ed docs: audit v3 admission and reclaim liveness replacements 2026-11-18 15:54:34 -08:00
pingqiu cf888fa844 test: cover native v3 admission liveness across five WAL laps 2026-11-18 15:52:58 -08:00
pingqiu ce1cba2f82 fix: keep missing-writer binding error out of pressure wait 2026-11-18 15:17:39 -08:00
pingqiu 8529530c4b fix: preserve binding refusals before capacity waits 2026-11-18 15:15:15 -08:00
pingqiu 1534404f7f test: use backend buffer read contract in burst oracle 2026-11-18 14:55:12 -08:00
pingqiu 44eea4ee49 fix: use native v3 WAL pressure for write admission 2026-11-18 14:54:00 -08:00
pingqiu ed23f149e2 test: make COW corruption and batch oracles precise 2026-11-18 12:31:01 -08:00
Ping Qiu 61255b94ce Merge pull request #213 from seaweedfs/test/wal-v3-wrap-forged-replay
storage: end-to-end v3 wrap/forged-replay test; spec open items 1-2 resolved in v3
2026-11-18 12:15:34 -08:00
pingqiu cd6dff4f67 storage: copy native chunk cut images outside the write barrier
Fix H and candidates under the short barrier; save pending chunks before mutation.
Drain owners and waiters before cleanup, recovery, reset and close. Preserve
intent/CAS and local durability contracts. Include native caller controls,
existing model correspondence and a real-mount rehearsal note.
2026-11-18 12:05:39 -08:00
pingqiuandClaude Opus 5.5 83eb3d3d93 storage: end-to-end v3 test of the wrap/forged-replay scenario; spec open items 1-2 resolved in v3
TestWALStoreV3StaleLapBytesAtTheWrapAreNotReplayed replays the forged
replay reproduction (docs/spec/README.md, open item 2) end to end on a
mapped v3 WALStore: a guest batch in lap 1 carries a well-formed record
bound to the volume's own nonce at its lap-1 cursor (LSN 999, LBA 7); the
WAL wraps so one newer record overwrites only the batch's start and the
lap-2 scan resumes exactly at the embedded record. The cursor binding
stops the scan there; after a crash and reopen the frontier is the newest
real LSN and LBA 7 is never the forged data. With the lap dropped from the
cursor check the scan admits the record and the test fails.

README: open items 1 (corrupted synced records) and 2 (forged replay) move
to "resolved in v3 (code)", citing the v3 tests. Still open: the mode C
newest-batch residual (silent truncation until an idle refresh or
SetWMode(A)) and the TLA model, which has no nonce/cursor/lap binding
(S3v1_root_lww_I1 and S3f_* rerun on cc5cf09a with TLC 2.19: unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:18:58 -08:00
Ping Qiu cc5cf09af0 Merge pull request #212 from seaweedfs/refactor/remove-production-c11-bitmap
Remove production C11 file bitmap persistence
2026-11-18 09:34:45 -08:00
Ping Qiu bcd86f6659 Merge pull request #211 from seaweedfs/fix/rf1-write-log
replication: drop the per-write INFO line at RF=1 (#204)
2026-11-18 09:34:34 -08:00
pingqiu 3987ae0e52 test(storage): retain C11 fixture evidence outside production graph 2026-11-18 08:14:54 -08:00
pingqiu b0ff0c21a6 refactor(storage): remove production C11 file bitmap store 2026-11-18 08:14:18 -08:00
pingqiu c76b5c6d6f test(storage): forbid production C11 file persistence 2026-11-18 08:12:04 -08:00
pingqiuandClaude Opus 5.5 7fab4770c2 replication: drop the per-write INFO line from the local write path (#204)
At RF=1 every local write logged 'replication: OnLocalWrite volume=...
lba=... lsn=... peers=0'; under sustained writes one volume's log grew to
162 MB in 13 minutes and the useful lines were buried. The counters (Stats:
WriteOps, WriteFanoutNanos) keep the per-write evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:09:06 -08:00
pingqiuandClaude Opus 5.5 cfbec68926 replication: RED: a local write must not log one line per write (#204)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:08:35 -08:00
Ping Qiu 56af794492 Merge pull request #197 from seaweedfs/feat/walstore-format-v3
storage: walstore format bump v3 (#51, #189)
2026-11-18 08:07:17 -08:00
Ping Qiu 7a5abaa02e Merge pull request #208 from seaweedfs/activate/format-v3-12b-r2
feat(storage): activate mapped walstore v3 on the reclaimed-WAL base
2026-11-18 07:55:34 -08:00
Ping Qiu 4644a3400c Merge pull request #209 from seaweedfs/fix/workspace-lease-horizon
workspace: answer lease renewals from memory under a durable horizon (#205)
2026-11-18 07:46:41 -08:00
Ping Qiu 22fe6eae01 Merge pull request #207 from seaweedfs/fix/workspace-lease-trigger
volume: name the cause when the workspace lease guard fences (#205)
2026-11-18 07:42:09 -08:00
Ping Qiu ce589edaa7 Merge pull request #203 from seaweedfs/docs/cow-cut-design
docs: propose copy-before-write for the cut window, with its TLA+ model
2026-11-18 07:42:02 -08:00
pingqiu 80ba50dfd2 test(replication): pin WAL across both two-replica catch-up sessions 2026-11-18 07:22:56 -08:00
pingqiuandClaude Opus 5.5 6f5710a11b spec(workspace): record the WorkspaceTakeover rerun for the durable horizon (#205)
All 27 W4_*/RED_* configurations re-run against the model at 7dd83eb6
(TLC 2.19, BFS): existing passes still pass, the new horizon
configurations pass with failing extension writes and a restart,
RED_hz_noclamp violates HostWithinHorizon as expected, the existing REDs
and witnesses keep their verdicts, the two large and the two "both"
configurations reached their time limits with no violation, and the two
open findings (W4_drift, W4_forced_exact) are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 07:12:54 -08:00
pingqiu d4ebc48ef7 test(durable): handle caller expiry before recovery reaches the remote 2026-11-18 06:15:52 -08:00
pingqiuandClaude Opus 5.5 7dd83eb6c0 spec(workspace): model the durable lease horizon in WorkspaceTakeover (#205)
lease.exp is now the published horizon, dhz the horizon on disk and
deadline the latest grant. A renewal of a live lease writes nothing:
grant = min(now + TTL, horizon), refused while uncertain or without
validity, and it may trigger an extension. The extension (MasterExtend)
is an ordinary serialized writer that raises the horizon to
trigger + TTL + HSlack; with ExtFail its write may fail without landing or
after landing, and either way latches uncertain. Revocation, ACK and move
writes are refused while uncertain; a restart reloads the disk horizon and
clears uncertainty. The revoking drain reply is clamped to
min(horizon, deadline). Nondecreasing time is stated as a model assumption.

New invariants HostWithinHorizon and DiskCoversMemory; witnesses
W_NoExtension, W_NoExtLanded, W_NoUncertain. New cfgs W4_hz_* (failing
extensions, clean/forced/both, one restart) and RED_hz_noclamp (no clamp:
EXPECTED to violate HostWithinHorizon) with the control
RED_hz_noclamp_safety (no clamp, split-brain invariants: expected to pass,
the restart rule covers grants). Existing cfgs gain Clamp = TRUE and
ExtFail = FALSE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 05:28:45 -08:00
pingqiuandClaude Opus 5.5 42e828a14c test(workspace): strengthen the concurrency control, bound held-write cleanup (#205)
Review folds, tests and docs only:
- The combined concurrency control now requires its schedule: a bounded
  handshake holds the first horizon-extension write inside the store
  while renewals keep succeeding and the writers and Close are in flight
  behind it, then releases it. It counts successful grants per eligible
  volume and extension writes classified by content (a raised horizon at
  the same epoch, not an ordinary writer's record) and requires both.
- It adds the forced-move arm next to the clean move: the forced volume
  is granted at an earlier injected time, so its horizon + skew barrier
  has passed when the writers run; the clock only moves forward.
- Held-write controls install their release cleanup before the hold is
  triggered, bound every admission and completion wait, and on any
  failure release, settle workers with bounded joins and only then close
  fixtures.
- Docs: an uncertain volume refuses renewals that would issue a new or
  extended grant; a Revoking lease still gets its bounded drain reply,
  min(horizon, deadline), never extended, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 05:22:00 -08:00
pingqiuandClaude Opus 5.5 c74f8d1afb fix(workspace): no mutual recursion between renewal and first grant (#205)
If another writer created the lease after the renewal read the view, the
first-grant path now returns a retryable error instead of re-entering the
memory path. The host has no deadline before its first grant, so a failed
first renewal does not fence it; its retry takes the memory path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 05:07:26 -08:00
pingqiuandClaude Opus 5.5 dfd65907d4 test(workspace): log unrounded renewal timings in r1-r5 (#205)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 05:01:45 -08:00
pingqiuandClaude Opus 5.5 521e1e8cb2 docs(workspace): invariants and lease docs for the durable horizon (#205)
- invariants.md: M2 lease rows (first grant writes the horizon, renewal
  from memory under a clamp, revoking reply carries the grant, expiry
  and forced barrier on the persisted horizon); new rows
  INV-LEASE-VIEW-001, INV-WS-LEASE-HORIZON-001,
  INV-WS-RENEW-NONBLOCKING-001 and INV-LIFECYCLE-SNAPSHOT-001;
  INV-WS-FORCED-MOVE-001 now names the horizon and the reply clamp.
- INV-AUTH-UNCERTAIN-001 moves from STUB to ACTIVE: its renewal reader is
  documented, and the ambiguous-extension control now also asserts that
  a revocation and an endpoint change of the uncertain volume are
  refused.
- Proof-text folds: the forced-barrier argument assumes nondecreasing
  master time, an assumption of the current WorkspaceTakeover model,
  not a consequence of time.Now's monotonic reading; the horizon
  invariant treats an ambiguously persisted issued successor (lease
  cleared) as the ordered clean-handoff or forced-barrier case.
- agent-workspace-design.md section 7 and workspace-lease.md: the
  master side of a renewal, the extension, the capacity bound, the logs.

The WorkspaceTakeover specification is not changed here; its update and
recorded configuration results are a later acceptance step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 05:00:43 -08:00
pingqiuandClaude Opus 5.5 31b911dac7 test(workspace): safety controls for the lease horizon (#205)
GREEN-gating controls for the memory-only renewal:
- grants clamp to the durable horizon under a permanently stalled
  store, renewals without host validity or at the horizon are refused,
  and a real guard fences by horizon - skew/2;
- a restart honours the persisted horizon in the forced barrier;
- an extension whose rename landed but whose directory sync failed
  latches uncertainty, refuses the next renewal, and reloads with the
  landed horizon barring a forced move until horizon + skew;
- an extender held inside its write orders a same-volume revocation or
  forced move after it;
- same-volume renewals during held revocation and forced-move writes;
- the lease view equals derive(published) after every writer kind;
- N volumes renew concurrently with apply, revocation, ACK, a clean
  move, extenders and Close (run with -race);
- Close joins a held extender, and an extender admitted before closing
  writes nothing;
- lifecycle snapshots follow every records change, stay immutable, are
  read without the store mutex, and keep a protective unknown outcome;
- through the services layer, query and revoke replies report the
  grant, and a renewal during a held same-volume reservation returns
  the revoking lease.

The r1-r3 slow-store wrappers count the delayed writes and require at
least one, so a green cannot bypass the injected stall. Tests that own
a Publisher directly join its extenders before their store closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 04:58:54 -08:00
pingqiuandClaude Opus 5.5 a4fd1303ef fix(workspace): answer lease renewals from memory under a durable horizon (#205)
A renewal of a live workspace lease persisted the new expiry with a
temp-file fsync under the publisher's global lock, and the renewal RPC
also read two lifecycle stores whose mutexes writers hold across file
I/O. A slow or busy master disk therefore made the host's 2 s renewal
RPC time out, the guard fence and the volume shut down.

Renewal now takes only a small leaf lock (leaseMu) over a per-volume
lease view and does no I/O:
- grant = min(now+TTL, durable horizon), where the horizon is the
  published Lease.ExpiresAtNS; the deadline is raised to the grant.
- It refuses stale, pending-move, expired, uncertain or storeless
  state as before (never bypasses INV-AUTH-UNCERTAIN-001), and refuses
  with an error when the grant would leave no positive host validity.
- The first grant of a lease still writes synchronously under p.mu and
  persists horizon = now + 1.5*TTL.
- A per-volume single-flight extender is an ordinary p.mu writer: it
  writes horizon = trigger + 1.5*TTL through persistWorkspaceLocked, so
  its write and publication are one p.mu section; any write error
  latches uncertainty as before.

Writers keep persist-before-publish and refresh the view (p.mu ->
leaseMu, the only new lock edge) at every derive-input change.
Revocation and query replies report the granted expiry, never the
horizon. Host.Close joins extenders before the store closes.

The renewal RPC reads lock-free immutable snapshots of the Volumes and
deletion-reservation stores, republished at every records change
(including load, delete and the protective unknown outcome).

Behaviour change: a forced move now waits for the durable horizon plus
skew, at most TTL/2 later than before. Existing tests that read the
persisted lease as the grant, or waited only grant + skew, are updated
with that reason. The store-write boundary guard now skips _test.go
files: a test double that delays and delegates Put is not a production
write caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 04:58:54 -08:00
pingqiuandClaude Opus 5.5 1193cb751b test(workspace): reservation persist hook and RED for renewal behind a held lifecycle write (#205)
Add DeletionReservationStore.SetPersistHookForTest, an instance-local
test seam that installs the existing write-fault hook under the store
mutex (nil by default).

r5: while the deletion-reservation write of an unrelated volume is held
in that hook, a renewal through the services layer must return within
2 s. On main it waits on the reservation store's mutex.

r4 and r5 now release held writes first and settle every worker with
bounded waits before clearing hooks or closing fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 04:42:15 -08:00
pingqiuandClaude Opus 5.5 c5192fc4c1 test(workspace): RED for renewal blocked by an unrelated held write (#205)
r4: while the revocation write of volume a is held inside the
authority store, a renewal of volume b must return within 2 s.
On main the renewal waits on the publisher's global lock until a's
write is released.

Tests only; no fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 04:23:12 -08:00
pingqiu 731b1118eb test(replication): retain WAL for both RF2 catch-up sessions across checkpoint 2026-11-18 04:23:00 -08:00
pingqiu fbd33f9712 test: restore native typed cut controls and close activation isolation coverage 2026-11-18 04:16:20 -08:00
pingqiuandClaude Opus 5.5 c902547a44 volume: name which limit a late renewal reply missed
Review fold for #207: a valid reply that lands after the renewal call's
context ended, while the old lease and the new grant are still valid, was
recorded as "arrived after the lease deadline". The refusal is unchanged;
the cause now says which limit the reply missed: the lease deadline, its
own grant, or the call's context (with the lease's remaining validity).
Adds a bounded regression where the reply lands just after the 2s call
timeout with a 20s lease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 04:12:40 -08:00