Commit Graph
3018 Commits
Author SHA1 Message Date
pingqiu ebc0f5d3cd fix: retain FIFO WAL admission tickets through append 2026-12-02 04:12:10 -08:00
pingqiu 56289b4fdb feat: distinguish final-error device WAL hold windows 2026-12-02 04:12:10 -08:00
pingqiu cf98b6928c feat: track WAL hold inactivity separately for each command 2026-12-02 04:12:10 -08:00
pingqiu 84111fd66f feat: validate declared host timeout against WAL hold cap 2026-12-02 04:12:10 -08:00
Ping Qiu d370582710 Merge pull request #938 from seaweedfs/fix/recovery-stalled
host: recovery_stalled counts every synced startup slice and pauses for the master's authority wait
2026-12-02 04:11:34 -08:00
pingqiuandClaude Opus 5.5 9b6114bfe3 storage: the held-sync control bounds every wait and owns its worker
Waiting for the held slice and for the recovery's return is bounded, and on
every exit the test releases the hold, joins its recovery worker (bounded)
and only then closes the store, so a regression fails the test instead of
hanging it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 03:36:38 -08:00
pingqiuandClaude Opus 5.5 49ca6baf55 durable: the authority pause follows every transition, not only the first grant
A grant whose attach failed and whose authority was then lost returned to
the wait without a new pause, so the master's resumed wait could read as a
stall. The pause now starts whenever authority is missing and ends at each
grant, before the local attach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 03:30:23 -08:00
pingqiuandClaude Opus 5.5 cb542b3c21 host, durable: the authority pause ends at the grant and latches silence before it
Review fixes. The provider ends the stall window's pause when authority is
granted, before the local attach, so a stuck attach is a stall again; the
first authority wait latches silence that already filled the window, so the
pause cannot hide it and its end cannot erase it. The held-sync and
held-attach tests release their holds before Close on every exit, and the
real prezero gets a sync seam with an order and a failed-sync control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 03:05:09 -08:00
pingqiuandClaude Opus 5.5 1d60144e70 storage: the owned-map checkpoint retires its dirty entries once
publishCheckpointV3 already sets the checkpoint and retires every dirty
entry at or below it under the store lock; its owned-map caller walked
the dirty map a second time for nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 02:50:58 -08:00
pingqiuandClaude Opus 5.5 009e9bb188 storage: recovery's fence progress keeps a fence hook already set
Recovery replaced any fenceSliceHook for the fence and then cleared it,
so a hook set by its caller saw nothing. It now calls that hook first and
restores it afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 02:23:33 -08:00
pingqiuandClaude Opus 5.5 6bf0445fcd host: recovery_stalled counts every synced startup slice and pauses for the master's authority wait
The startup inactivity window renewed only on replay, scan, map and attach
work. A new store's prezero and the WAL fence wrote and synced whole
regions with no report, so on a slow disk the window could end inside one
silent step; and the chunk layer's wait for master authority, a wait the
master bounds, ran out the same window.

- storage: phases RecoveryCreate and RecoveryFence; syncedSlices runs a
  sized step 4 MiB at a time and reports a slice only after its sync;
  prezeroNewStore uses it, and recovery reports the fence's synced bytes.
- durable: create passes RecoveryProgress; AuthorityWait tells the host
  when the authority wait starts and ends; Chunk.AuthorityGap names the
  projection fields that withhold authority.
- host: recovery_timeout becomes recovery_stalled; waits are counted, the
  window pauses while any runs and restarts when the last ends, a stall
  latched before stays latched; /status RecoveryWait=awaiting_authority.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 02:23:33 -08:00
pingqiu 28125bf8dc Merge remote-tracking branch 'origin/main' into fix/flusher-bounded-cycles
# Conflicts:
#	docs/releases/v1.1.md
2026-12-02 01:57:45 -08:00
pingqiuandClaude Opus 5.5 74cca8ca05 storage: the production drain and the leader wait run in bounded children
The held-checkpoint control now also drives the production flushOnce, in
a bounded child process of the test binary: a drain that repeats its
batch is killed and reported at the bound. The leader-wait control moves
to its own bounded child, so its worker is always received before the
store's cleanup and a stuck one dies with the child. An injected fence
write error takes the real WriteAt error's path (one wrap and latch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:40:19 -08:00
pingqiuandClaude Opus 5.5 eec85d11ec storage: tests bound their drains and fail real fence slices
The held-drain controls run the drain loop on the test goroutine with a
cycle bound, and the leader-wait control joins its worker before the
store's cleanup on every path. The fence's slices are checked at their
fsync (the counter holds only the completed slices there), and a second
slice's zero write or fsync fails through test seams: no credit for the
failing slice, no completed fence recorded, the store latched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:26:24 -08:00
pingqiuandClaude Opus 5.5 d5c2fbdeae docs: regenerate the status schema for the checkpoint step fields
The status schema's generated block takes its descriptions from the
fields' comments: the checkpoint step fields now carry them, and the
block is regenerated (STATUS_SCHEMA_UPDATE=1) instead of hand-edited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:13:24 -08:00
Ping Qiu 16bdd6bbd8 Merge branch 'main' into feat/v11-declare-format 2026-12-02 01:11:46 -08:00
pingqiuandClaude Opus 5.5 e709950124 storage: the recovery fence zero-fills in 4 MiB slices
The fence stays a zero fill (a punched WAL would make the next lap's
appends allocating writes, each fsync committing metadata); the hole
punch is removed. The fill now runs in 4 MiB slices, each written,
fsynced, and only then counted (FenceZeroed) and reported to
fenceSliceHook, the per-slice recovery-progress hook: a recovery over a
slow disk shows progress every slice and the journal never takes the
whole WAL as one burst. The repeat skip stays: a new volume's second
recovery does not fill again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:57:37 -08:00
pingqiuandClaude Opus 5.5 af34018f46 storage: a fence on a store without open v3 state keys no repeat
fenceV3 is also called on a bare store (a test of the restore frontier);
the repeat key needs the descriptor publisher, so without it the fence
runs and records nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:34:39 -08:00
pingqiuandClaude Opus 5.5 1e40d947da Merge main into the declare-format branch: the HEAD guard with the stamp
runTransition now runs the format level guard first (it refuses only a
raise of HEAD from version 0 to 1 below level 1; stamping never changes
the version, so a refused write is never stamped), then the write-time
snapshot stamp, then the write check. The stamp tests run a v1.1
holder's cut at level 1; the v1.0 landing control pins v1.0 whatever the
package mode. Both invariant rows are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:34:27 -08:00
pingqiuandClaude Opus 5.5 fcb5f608ac storage: the recovery fence punches holes, and a repeat is skipped
Every recovery zeroed the whole WAL range with pwrites and fsynced it:
the WAL's size in writes on every open, twice on a new volume. On Linux,
with the default sparse allocation, the fence now deallocates the range
(a hole punch, which reads zeros) and then fsyncs; where the filesystem
cannot punch, or off Linux, or on a prezeroed store, it writes zeros as
before. A recovery skips the fence when the same range was fenced and
fsynced in this open by the same writer with no WAL write since (a new
volume's second recovery). The fence's bytes count only after its fsync:
status reports FencePunched, FenceZeroed and FenceSkips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:23:43 -08:00
pingqiuandClaude Opus 5.5 9c536f5038 Merge main and fix/nvme-command-retry-delay
Conflict in docs/design/invariants.md: main added INV-FE-NVME-CANCEL-001
where this branch adds INV-NVME-RETRY-DELAY-001 and
INV-NVME-HOST-BEHAVIOR-001; all three rows kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:02:19 -08:00
Ping Qiu 062f94470d Merge pull request #932 from seaweedfs/fix/929-nvme-connection-cancel
Cancel NVMe provider readiness waits when the target closes
2026-12-01 23:53:45 -08:00
pingqiuandClaude Opus 5.5 5b486edcd5 storage: one checkpoint step retires every entry below it; time its steps
Setting the store's checkpoint and retiring every dirty entry at or below
it are one function on every path (the owned map's publication and
rollover, the map candidate's, the flusher cycle's own retirement): a
checkpoint that jumps past entries a pass wrote while it was held leaves
none of them dirty, pointing at WAL records the released tail lets the
writer reuse.

The checkpoint's steps are timed where they happen: the hooks, the owned
map's page writes and fsyncs, the waits for the leader role and the store
lock, the descriptor slot writes and fsyncs (the store file), and the
retirement. Status reports the step in progress with its start, and per
step the time, count and bytes written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:49:45 -08:00
pingqiuandClaude Opus 5.5 aebf1d42c7 storage: a v1.1 attach needs a remote that takes the HEAD format
SetHeadFormat reports whether the remote took the format; the provider's
wrapper answers false over a remote without it, so a v1.1 attach refuses
before anything local is written instead of upgrading behind a v1.0
writer. A provider test over the real layout store proves the assigned
level decides the stored HEAD bytes across a restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:48:59 -08:00
pingqiuandClaude Opus 5.5 2184f8049b Merge branch 'main' into fix/nvme-command-retry-delay
Conflict in core/frontend/nvme/session.go: main added the rate-limited
write-failure log before the completion status; this branch computes the
status through the session (negotiated retry delay). Both kept: the log,
then s.completionStatus(res).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:39:55 -08:00
pingqiuandClaude Opus 5.5 4c0e826f7d durable: keep the attach level next to the attach
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:32:54 -08:00
Ping Qiu fa16e037d9 Merge branch 'main' into fix/head-v1-stamp-once 2026-12-01 23:32:53 -08:00
Ping Qiu 4831af27ce Merge branch 'main' into fix/929-nvme-connection-cancel 2026-12-01 23:32:37 -08:00
Ping Qiu 3cbb7cf2eb Merge pull request #911 from seaweedfs/feat/b1-candidate-bitmap
storage: a cut's guest pause does O(1) work; candidates by change
2026-12-01 23:32:33 -08:00
pingqiuandClaude Opus 5.5 4184e30af4 storage, layout: the attach level comes from the assignment; one HEAD write guard
The host keeps the format level of every assignment no older than the
newest, the frontend projection carries it, and the provider attaches the
chunk layer at it (absent = 0). At level 0 the attach reads HEAD first: a
version-1 HEAD runs v1.1 (reported behind), a v1.1 store under a
version-0 HEAD is refused, anything else stays v1.0. A v1.1 attach over a
remote without the HEAD format is refused. The layout's one HEAD write
path refuses a write that raises HEAD from version 0 to version 1 below
format level 1, whichever writer tries; writers supply their level in
their context. The running format is in the chunk stats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:32:23 -08:00
Ping Qiu 22783f605d Merge pull request #909 from seaweedfs/test/noflush-passive-progress
durable: test, the no-flush passive wait follows the flusher's cycle
2026-12-01 23:26:41 -08:00
pingqiuandClaude Opus 5.5 d6bf9aa03a storage: the WAL flusher reclaims in bounded cycles
A flusher cycle drained the whole dirty map before one fsync and one
checkpoint, so on a slow disk no WAL byte was freed until the cycle ended
and a write waiting for space timed out while reclaim was running. A
cycle now takes the LSN prefix of the synced entries that fits in a
sixteenth of the WAL, cut at a record boundary (a native batch's blocks
stay together), and checkpoints at its last LSN; the run loop starts the
next cycle at once while entries remain. A pass position moves each
cycle past the previous batch, so a checkpoint held below a batch does
not repeat it, and it is trusted only within one recovery lifetime. A
full drain runs cycles until its first frontier is drained.

The durable status's checkpoint persistence gains the reclaim counters
(ReclaimedBytes, BoundedCycles, FlusherPhase, CycleStarted,
CycleExtentBytes, LastExtentWrite), and WALStore.ReclaimProgress reads
them without a store lock for a write's hold path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:22:57 -08:00
Ping Qiu e06bc933f6 Merge branch 'main' into fix/head-v1-stamp-once 2026-12-01 23:14:17 -08:00
Ping Qiu 0cf187152d Merge branch 'main' into feat/b1-candidate-bitmap 2026-12-01 23:11:54 -08:00
Ping Qiu 34a3dc6af9 Merge pull request #931 from seaweedfs/fix/record-commit-needs-hash
storage: the record's Commit needs a hash it holds (v1.0 landed chunk)
2026-12-01 23:11:36 -08:00
Ping Qiu 45926a51f5 Merge branch 'main' into fix/929-nvme-connection-cancel 2026-12-01 23:09:22 -08:00
Ping Qiu 31e23aba4b Merge branch 'main' into test/noflush-passive-progress 2026-12-01 22:56:37 -08:00
Ping Qiu 8ee5abbe53 Merge branch 'main' into fix/head-v1-stamp-once 2026-12-01 22:52:19 -08:00
Ping Qiu 5085b13695 Merge branch 'main' into fix/record-commit-needs-hash 2026-12-01 22:51:17 -08:00
Ping Qiu 512c0e1db6 Merge branch 'main' into fix/nvme-busy-write-diagnostics 2026-12-01 22:51:13 -08:00
pingqiu c284f788a3 test: witness provider cancellation before target close returns 2026-12-01 22:35:07 -08:00
pingqiu d5da9b1dd1 Merge remote-tracking branch 'origin/main' into feat/v11-declare-format 2026-12-01 22:29:28 -08:00
Ping Qiu 7f8367c495 Merge pull request #913 from seaweedfs/feat/format-gate-master
master: cluster format level (FORMAT-GATE): finalize-format, level-0 v1.0 semantics, retire-host
2026-12-01 22:28:14 -08:00
pingqiuandClaude Opus 5.5 9a4078e17a storage: the v1.1 format follows the assigned level, not a build tag
A chunk layer decides its format once at attach from its config's
FormatLevel and the store's marker: level 1 upgrades a v1.0 store; level
0 keeps it on v1.0; a store already on v1.1 at level 0 is served over a
version-1 HEAD (reported as format_level_behind_volume) and refused over
a version-0 HEAD (format_level_behind_store). The layout remote's HEAD
format follows its layer (SetHeadFormatV11) and reports the version it
read (HeadV11). Every production attach is level 0 until the assignment
carries the master's level, so a release build keeps writing v1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:27:16 -08:00
pingqiu 64b36ffa50 fix(nvme): cancel connection readiness waits when target closes 2026-12-01 22:13:03 -08:00
pingqiuandClaude Opus 5.5 2d2327e8e8 durable: test, every store read on the busy path is bounded
The no-flush busy path observes the store only through a bounded
snapshot: the checkpoint at the busy write, the target, the retry log
and the timeout diagnostic, which reports the last observation (or
"unavailable") instead of a fresh read. The busy-path check is a
function the burst test calls, so a control drives it with the store
lock held across the deadline at each observation, and released early.
The wait's control gains an early-release case that must return the
advanced checkpoint, a lower bound for the held case, and joins every
fake read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 22:05:37 -08:00
pingqiuandClaude Opus 5.5 4753c7ed20 storage: guard that v1.1 extent writes never land an absent chunk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:56:14 -08:00
pingqiuandClaude Opus 5.5 81600716ca durable: test, the passive checkpoint wait is bounded by its deadline
The passive wait's checkpoint read takes the store's read lock, which a
checkpoint publication holds across its descriptor I/O; a stall there kept
the loop from rechecking the write's retry deadline. The wait is now
passiveCheckpointWait, with every read through boundedRead (a read still
blocked at the deadline ends the wait, reported as blocked), and no read is
started after the deadline.

TestPassiveCheckpointWaitIsBoundedByItsDeadline: a read blocked behind a
held lock, and a checkpoint that never advances, each with the flusher
always in a cycle, end at the 300 ms deadline; with the read unbounded the
first case hangs until the test's timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:55:45 -08:00
pingqiuandClaude Opus 5.5 f8b3b85989 storage: the record's Commit needs a hash it holds
On a v1.0 shadow a cut can capture a written absent chunk while its
absence stands (no Hash), and the flusher can then complete the chunk's
local bits (P to U, no version change) before the publish. The publish's
Commit met U and the kernel refused it. Commit is now sent only when the
record holds the chunk's hash (HU or HP); the chunk stays a candidate.

Fixes #922.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:46:25 -08:00
Ping Qiu 437c11129c Merge branch 'main' into fix/nvme-busy-write-diagnostics 2026-12-01 21:35:25 -08:00