Commit Graph
4700 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 1add3afcd0 storage: the barrier only swaps the touched sets; a late recovery is a flag
- prepareTouched, before the barrier and outside the pause, runs the
  once-per-layer seed, a pending recovery's clean-fill touches, and makes
  the cleared spare set; takeTouched at the barrier is a pointer swap.
- A recovery that lands between prepareTouched and the barrier is taken
  at the barrier as a flag (O(1)): the window covers every chunk until it
  narrows, and the clean fills are judged after the pause, with the
  touched set's members. A refusal before the judgement keeps the request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:13:14 -08:00
pingqiuandClaude Opus 5.5 d8f828275a storage: red tests, no touched-set allocation or fill scan in the pause
- The touched set's allocation and the recovery's clean-fill enumeration
  now count themselves in PauseCandidateOps when the guest is paused.
- TestAColdFirstCutAllocatesNoSetInThePause: a layer's first cut at the
  1 TiB shape (fails: 4,097, the spare set allocated at the take).
- TestARecoveryJustBeforeTheBarrierIsJudgedAfterThePause: a recovery
  between the pre-barrier work and the barrier (fails: 9, the clean fills
  enumerated at the take); the cut must still judge every clean fill.
- TestTheFirstCutAfterWritesDoesNoPerCandidateWorkInThePause now fails
  too (the spare allocation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:06:08 -08:00
pingqiuandClaude Opus 5.5 72e429830c storage: the guest pause does O(1) work; the candidates are judged after it
In the pause, a cut now syncs (H), takes the touched set and the dirty set
by pointer swaps, and opens the copy window over what they name (a
superset of the candidates, a lookup per chunk). Everything per candidate
runs after the pause, under the window: the judgement (WAL entries up to
H), the known-equal filter, each candidate's version, staged reuse, the
record shadow check, the base refs, the copy-order hint and the
HEAD-behind refusal. The window then narrows to the candidates.

- A candidate's version at the barrier is read atomically with the write
  path: the version a guest write's save recorded with its bytes, else the
  live one under the window lock. The window closes on a chunk only after
  its version is read and it is uploaded.
- A refusal before the judgement returns the taken sets (touched again,
  the dirty set rejoins l.dirty). After it, the existing requeue does.
- A pre-copy attempt keeps its drained frontend drained through the
  judgement and decides its freeze on the judged tail, as before: its guest
  pause runs to that release.
- The record shadow check exempts chunks written since the barrier (the
  live touched set): the record already counts those writes.
- PauseCandidateOps counts per-candidate operations while the guest is
  paused; it is 0 for an ordinary cut. The cut body and the status schema
  carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:58:17 -08:00
pingqiuandClaude Opus 5.5 3f911ff43f storage: red test, the guest pause does no per-candidate work
TestTheFirstCutAfterWritesDoesNoPerCandidateWorkInThePause: the first cut
after writes to many chunks must do no per-candidate operation between the
barrier's lock and its release, at 32 blocks and at the 1 TiB shape with
256 changed chunks (fails: 73 and 1,600 operations; the candidate step,
the known-equal filter, versions, the base refs and the copy-order hint
all run in the pause).

Seam: chunkCutStats.PauseCandidateOps, counted while a pause flag is up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:30:22 -08:00
pingqiuandClaude Opus 5.5 3dd2c6af89 storage: the cut's copy window is installed in O(1) at the barrier
The window no longer sorts the candidates and makes one entry (with its
channel) per candidate inside the guest pause. It keeps the candidate set
and the staged marks (immutable once installed) and makes a chunk's entry
on its first touch: a guest write's save or the copier. Side-file slots
are handed out in touch order. After the pause, the copier lists the
covered chunks that a pre-copy does not hold and no touch has finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 19:26:58 -08:00
pingqiuandClaude Opus 5.5 306831c07f storage, volume: candidate set review: absent-to-present touch, oracle, telemetry
- A fill's install (absent to present) touches its chunk: a fetch that
  outlived a same-open recovery installs HEAD's bytes with no clean mark,
  and the full scan made that chunk a candidate; now the touched set does
  too (TestAFillThatOutlivesARecoveryMakesItsChunkACandidate, which fails
  without the touch).
- Under this package's tests every barrier runs the full scan as an oracle
  (candidateOracle, nil in production) against the barrier's candidates
  with l.dirty and allDirty; a chunk it finds that the set missed is a
  finding. The whole package runs with 0 oracle findings.
- chunk_layer.go carries the table of each predicate input that moves and
  what touches the chunk, including the clears that need none.
- The cut body (/chunk/cut) and the status schema carry CandidateVisits and
  PreSyncNs.
- The unknown-outcome guard compares the remote's full images (any store
  format) and asserts the injected cut's outcome is unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:52:10 -08:00
pingqiuandClaude Opus 5.5 a9724ba81e docs: the cut's candidate set by change
INV-WAL-V3-CAPTURE-CANDIDATES-TOUCHED-001 states the touched set and the
pre-barrier sync; the v1.1 notes carry them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:19:45 -08:00
pingqiuandClaude Opus 5.5 e1fb9cbd0d storage: the cut's candidate step judges a touched set, not every chunk
- The barrier's candidate step no longer walks the chunk map, nor the
  absent and clean-fill maps. It judges the members of a touched set, a
  chunk bitmap with a per-word summary (1 bit a chunk), with the same
  predicate the map scan used: (UNKNOWN and not known equal to HEAD) or
  above remoteLSN, minus absent chunks with no local write. The barrier
  takes the set by a pointer swap; readers (status, precopy, the record
  shadow) list a copy.
- The set is a superset of the chunks whose answer may have changed: every
  map entry change (OnMapEntryChange: a write's LSN, UNKNOWN by a direct or
  BASE mutation or a reused LSN), every version move, a HEAD install's
  changed refs (a whole install: the clean fills whose ref changed; a
  commit: its changed chunks), a recovery (every clean fill), and a
  once-per-layer seed on first use, outside the pause: every entry UNKNOWN
  or above remoteLSN, minus absent chunks with no local write.
- The cut syncs the store once right before its barrier, outside the
  pause (PreSyncNs, apart from BarrierPauseNs), so the pause's own sync has
  only what came after it.
- A test fixture that forgets clean-fill marks as a restart now touches
  those chunks, as a restarted layer's seed does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:07:24 -08:00
pingqiuandClaude Opus 5.5 a98d825054 storage: red tests, the cut's candidate set as an interval bitmap
- An idle cut's candidate step must visit at most the summary words plus a
  constant (counted, not timed) at 4,096 and 262,144 chunks (the 1 TiB SPACE
  shape); a one-chunk cut likewise (fails: the step visits every map entry,
  4,097 and 262,144).
- The cut must sync the store before its barrier, outside the pause, and
  report that time apart (fails: no sync before the barrier). A control
  checks the counter sees the pause's own sync.
- Guards, passing today and kept: an unknown commit outcome that did not
  land loses no chunk (its chunks and a later write are published by the
  next cut, nothing else changes); the candidate set's OR-back keeps the
  summary and each lists exactly the set bits.
- Seams: chunkCutStats.CandidateVisits, counting the candidate step's
  current visits, and PreSyncNs.

The candidate set type (a chunk bitmap with a per-word summary: set O(1),
walk O(C + S/4096), OR, clear) and the record runtime's take/return of it
come from an earlier parked branch, rebased onto the one-byte record codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:07:24 -08:00
Ping Qiu 4655664cf5 Merge pull request #903 from seaweedfs/fix/cgroup-unresolved-fallback
blockvolume: an underivable cgroup memory limit starts on the default
2026-12-01 17:40:12 -08:00
Ping Qiu a654ff23d0 Merge pull request #883 from seaweedfs/feat/v4b-pr4
storage: one-byte record kinds, the ref table, O(C) commits and no flat map on v1.1 (V4-B PR 4, commits 1-4 of 5)
2026-12-01 17:30:45 -08:00
Ping Qiu 72c2a63c33 Merge pull request #908 from seaweedfs/test/adopt-waits-frontend-ready
blockvolume tests: adopt waits for FrontendPrimaryReady before the first write
2026-12-01 17:25:23 -08:00
Ping Qiu f5444eb237 Merge pull request #895 from seaweedfs/feat/v5-incremental-build
authority: a heartbeat that changes nothing wakes no observation rebuild
2026-12-01 17:17:07 -08:00
Ping Qiu d14cf47fdf Merge branch 'main' into feat/v4b-pr4 2026-12-01 17:03:06 -08:00
Ping Qiu fb30cd8f80 Merge pull request #887 from seaweedfs/test/v11-format-tag
build: the draft v1.1 store format gets its own tag, apart from the cap lift
2026-12-01 16:52:06 -08:00
Ping Qiu 728ce66160 Merge pull request #901 from seaweedfs/fix/head-version-v11
layout: a v1.1 commit writes HEAD version 1, the manifest size known or not
2026-12-01 16:44:02 -08:00
pingqiuandClaude Opus 5.5 07b3d31697 blockvolume tests: adopt waits for the holder's frontend to admit I/O, not only a healthy primary
Fixes #905.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:44:01 -08:00
Ping Qiu 616e9a0a2f Merge branch 'main' into feat/v5-incremental-build 2026-12-01 16:23:42 -08:00
Ping Qiu 578827ff1e Merge pull request #896 from seaweedfs/feat/v5-restart-grace
authority: renewals write nothing; waits use the master's own deadline; records are version 2
2026-12-01 16:23:10 -08:00
Ping Qiu fe3f484a88 Merge branch 'main' into fix/cgroup-unresolved-fallback 2026-12-01 16:21:04 -08:00
Ping Qiu 061a8cd302 Merge branch 'main' into fix/head-version-v11 2026-12-01 16:10:52 -08:00
pingqiuandClaude Opus 5.5 9c8b30b66f storage: the publication report leaves the generation check to noteSettled
main's HEAD-generation source guard allows a generation comparison only in
conditional updates and noteSettled's deduplication. The two report paths
added here compared generations before calling noteSettled; they now call
it and let it drop a report of an unchanged generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:07:51 -08:00
Ping Qiu 3798d42bd3 Merge branch 'main' into feat/v5-restart-grace 2026-12-01 15:56:03 -08:00
Ping Qiu c7aad8586d Merge pull request #899 from seaweedfs/fix/newer-version-exit
blockvolume: a newer HEAD or store format exits 78, not a restart loop
2026-12-01 15:54:20 -08:00
pingqiuandClaude Opus 5.5 7a70a7a1ca blockvolume: an underivable cgroup memory limit starts on the default
With neither --memory-limit-mib nor GOMEMLIMIT, a cgroup v2 limit that
cannot be derived (a membership outside the cgroup2 mount of the holder's
mount namespace, an unreadable or malformed memory.max) is the no-limit
case: the holder keeps the 256 MiB default and starts, instead of exiting
2. applyMemoryLimit, run once logging is configured, logs one level=WARN
line naming the derivation's error and the two ways to choose a limit, and
status reports the reason in Memory.SoftLimitFallback (empty otherwise).
Only an explicit but invalid limit still refuses.

Docs: the flag's help, the operator guide's memory section, the status
schema and the v1.1 notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:46:02 -08:00
pingqiuandClaude Opus 5.5 6c4bd8b231 Merge main into feat/v4b-pr4
Conflict: core/frontend/durable/provider_chunk.go imports only (main
dropped math/rand/v2; this branch's EachSegment fallback uses math).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:45:31 -08:00
pingqiuandClaude Opus 5.5 aa512ab6d4 blockvolume, volume: red tests, an underivable cgroup limit starts on the default
- A holder whose cgroup v2 limit cannot be derived (its membership is
  outside the cgroup2 mount of its mount namespace, or memory.max is
  unreadable), with neither --memory-limit-mib nor GOMEMLIMIT, must start
  on the 256 MiB default and record why (fails: exit 2 on the derivation
  error). An explicit but invalid flag still refuses.
- Applying that limit must log exactly one WARN naming the reason and the
  two ways to choose a limit, and status must report the reason; a derived
  limit logs nothing (fails: no WARN, status empty).
- Seams: flags.memoryLimitFallback, applyMemoryLimit (now called after
  logging is configured), ProcessMemoryStatus.SoftLimitFallback,
  volume.SetSoftLimitFallback / SoftLimitFallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:41:31 -08:00
Ping Qiu 18d80d93e7 Merge branch 'main' into fix/head-version-v11 2026-12-01 15:40:18 -08:00
Ping Qiu 2e81e41347 Merge branch 'main' into feat/v5-incremental-build 2026-12-01 15:35:55 -08:00
Ping Qiu 45bee0b7c1 Merge branch 'main' into fix/newer-version-exit 2026-12-01 15:29:51 -08:00
Ping Qiu 4e4039e94e Merge pull request #898 from seaweedfs/fix/store-format-newer
storage: refuse a newer store format with a typed error and change nothing
2026-12-01 15:27:17 -08:00
pingqiuandClaude Opus 5.5 8ad9139fa6 layout: a v1.1 commit writes HEAD version 1, the manifest size known or not
HEAD's version followed the manifest size: a v1.1 commit by change over a
HEAD without a recorded size (an upgraded volume's first cut) left it at
version 0, a HEAD a v1.0 binary would read. A v1.1 commit now writes
version 1 whatever it knows of the size (CommitRequest.V11, set by the
layout remote on the v1.1 format), and a version-0 HEAD carrying a v1.1
manifest size is refused like one carrying ext.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:24:33 -08:00
pingqiuandClaude Opus 5.5 bbeb8d98aa authority: comments name the deadline barrier; gofmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:24:06 -08:00
pingqiuandClaude Opus 5.5 e7380482a8 blockvolume: real-systemd red for the newer-format exits
Under the shipped unit's restart policy, a holder that meets a local store
or a HEAD written by a newer format exits 78 with its reason and is not
started again; the store's bytes and HEAD stay as they were; the control,
a process of the same policy exiting 1, is restarted. Prebuilt binaries
of the same tree can stand in for the build on a host without Go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:17:57 -08:00
pingqiuandClaude Opus 5.5 2e9d6e04a7 authority: tests follow the lease deadline barrier; renewals write nothing
Tests that pinned the removed horizon (barrier at the persisted
issue+1.5*TTL, extension writes and their status counters) now use this
process's deadline (or restart floor) plus skew. The golden wm lost range
is the same file: the master restarts half a lease after the issue, so
both versions' barriers are the same instant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:12:45 -08:00
Ping Qiu d018f1c284 Merge pull request #889 from seaweedfs/feat/hostlimit-yield
hostlimit: a long cut yields its slot to a waiting cut after S
2026-12-01 15:12:16 -08:00
pingqiuandClaude Opus 5.5 55562d718e blockvolume: a master's final exit wins over a newer HEAD version
The newer-HEAD-version exit (78 head_newer_version) is chosen before the
master's final reasons, so a startup that also met a final refusal keeps
its exit: moved and deleted stay 78 with their reason, revoked stays 79.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:55:02 -08:00
pingqiuandClaude Opus 5.5 b0433c4bbf blockvolume: a newer HEAD or store format exits 78, not a restart loop
A startup that ends on a HEAD written by a newer version exits 78
head_newer_version instead of the restartable 75 (a restart reads the same
HEAD again), and a fatal open of a store written by a newer format exits 78
store_format_newer instead of 1. The provider latches the newer-version
refusal per recovery, beside the identity refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:55:02 -08:00
pingqiuandClaude Opus 5.5 868ee3c595 storage: the newer-format refusal's invariant row; narrow the discard claim
INV-STORE-FORMAT-NEWER-001: an intact descriptor of a newer store format
is refused typed, and an open refused at slot selection removes no file.
The discard's comment names what it covers: a refusal after the select
(a corrupt map) may still follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:55:01 -08:00
pingqiuandClaude Opus 5.5 495bbf8fe2 docs: status schema carries the cut yield counters
Regenerated with STATUS_SCHEMA_UPDATE=1: Chunk.Stats.CutsYielded and
Chunk.CutSchedule.CutYields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:44:30 -08:00
pingqiuandClaude Opus 5.5 49158029e7 hostlimit, storage, durable: a long cut yields its slot to a waiting cut
- hostlimit: Config.YieldAfter (S, default 5 min). ShouldYield answers yes
  only for a Normal hold at least S old while another cut on the host holds
  a live ticket this process has not judged stalled (dead tickets are
  reaped on the way); the probe runs only once the hold is old enough and
  takes no limiter lock.
- storage: a cut attempt asks at each staging batch boundary and ends with
  ErrCutYielded, keeping what it staged; CutsYielded counts it, never as a
  failed cut.
- durable: a yielded attempt is retried at the next poll with no backoff,
  on a ticket at the back (it was admitted), counted in status (CutYields)
  and not logged as a failure.
- blockvolume: --host-limit-yield-after. Invariants: INV-HOST-CUT-YIELD-001;
  M7 states the rule. v1.1 notes carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:44:29 -08:00
pingqiuandClaude Opus 5.5 62ee69b0e2 hostlimit, storage, durable: red tests, a long cut yields its slot to a waiter
Seams: Config.YieldAfter (S, default 5 min), Limiter.ShouldYield (never,
for now), storage.ErrCutYielded, storage.BudgetYield, ChunkLayerStats.
CutsYielded and CutScheduleStatus.CutYields.

- TestShouldYieldOnlyAfterSWithALiveWaiter: a Normal hold yields only once
  it is S old and another process holds a live ticket; never a lone hold,
  never before S, never an urgent hold, not for a ticket judged stalled.
  Fails here: no hold ever yields.
- TestCutYieldsAtABatchBoundaryAndKeepsItsStaging: a cut whose budget asks
  it to yield ends at the next staging batch boundary with ErrCutYielded,
  counted as a yield, not a failure, publishes nothing, and its staged
  chunks are kept for the next attempt. Fails here: the cut never yields.
- TestChunkLoop_AYieldIsRetriedAtOnceAndCountedApart: a yielded attempt is
  retried at the next poll, never backed off as a failure, and status counts
  it apart. Fails here: the retry came 1.1 s later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:43:22 -08:00
pingqiuandClaude Opus 5.5 2153edfedb storage: a v1.1 detach cancel is a commit by change with no change
On the v1.1 format a detach settlement whose detach did not land cancels
it with a commit by change carrying no change at the detach's base: HEAD
keeps the base's chunks and returns to this holder's active identity, and
no whole base image is built from the ref table. A cancel that lands is
installed in place; one whose reply is lost after it applied is read back
and adopted, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:43:15 -08:00
pingqiuandClaude Opus 5.5 ddc349abe8 master: refuse a nil decoded volumes map; a null v1.0.x attestation file migrates as {}
The envelope's volumes are checked on the decoded map (a later key of
another case can null it after a key probe), and a v1.0.x file that is
null is read as no attestations, as v1.0.x read it, so its envelope says {}
and the next start reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:25:54 -08:00
pingqiuandClaude Opus 5.5 9f82387047 master: the line-wake test publishes by the product tick it runs itself
The controller never bound a once-reported static volume on Linux, so the
test now creates and places a volume through the lifecycle, ingests its
holder's heartbeat, settles the observation host (started == done, no
buffered wake, no timer due), runs the product tick (the master runs none
by itself), which binds the volume, and requires a build after that point:
only the line-change hook can take it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:23:58 -08:00
pingqiuandClaude Opus 5.5 43efa2c82a storage: refuse a newer store format with a typed error and change nothing
A store whose descriptor slots are intact but name a chunk-state format
newer than this binary reads is refused with ErrStoreFormatNewer, told
apart before the slot's byte checks, instead of "neither descriptor slot
is valid"; a half-fence still opens on the known slot. Cut COW side files
are discarded only after a slot is selected, so a refused open leaves the
directory as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:22:43 -08:00
Ping Qiu 64398e8999 Merge pull request #891 from seaweedfs/feat/v5-line-index
authority: a per-volume line index; a call reconciles only its volume's bindings
2026-12-01 14:21:58 -08:00
pingqiuandClaude Opus 5.5 ac02f34d81 master: the attestation envelope is re-synced at every start; volumes must be an object
An envelope already on disk is fsynced (file and directory) at every start
before the master serves: an earlier start may have renamed it in and
failed its directory fsync. master.New releases the store lock when the
envelope cannot be made durable or the attestations cannot be read. A
format-2 file without an explicit volumes object (missing, null, wrong
type) is refused rather than read as no attestations; v1.0.x files with
volumes named format or volumes are still read as bare maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:21:37 -08:00
pingqiuandClaude Opus 5.5 518e418fe0 master: a v1.0.x master refuses to start on a store this version opened
Before it serves, under the authority store's lock, the master writes
store-attestations.json as {"format":2,"volumes":{...}}. A v1.0.x master
decodes that file as a bare map of volume records and returns the error
from New before it listens or publishes. This master reads the envelope
and v1.0.x's bare map (rewritten as the envelope at start) and refuses a
later format. The authority record's version 2 alone does not stop a
v1.0.x master (its loader skips such a record); the test is renamed to say
it fails the v1.0.x decoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:10:41 -08:00
pingqiuandClaude Opus 5.5 da6130636d storage: a v1.1 no-op cut fences a foreign root at its own identity
Commit by change made a v1.1 no-op cut compare only its captured chunks,
so a HEAD read whole that had moved, at this holder's identity, to another
chunk root was installed instead of fenced. A whole read's chunk root must
again be the one the layer holds (the ref table), as the full comparison
required; a HEAD moved with the same root still completes the no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:10:23 -08:00