Commit Graph
4662 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 fadc4f0345 format gate: per-process read levels, the publication boundary checks them, the clamped grant stays monotonic
A server's per-volume processes may run different binaries: the read
level is kept per process (its heartbeat slot's incarnation) and a server
reads the lowest any of its processes reported within the freshness
window. A heartbeat is judged on its own process's level.

The final publication boundary and the promotion gate check the target
server's current level, so an ask decided before an old process reported
is not published.

A level-0 grant clamped to the horizon is now + the time left to it, so
the deadline (read by the level-1 barrier after a finalize) keeps the
monotonic reading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:01:10 -08:00
pingqiuandClaude Opus 5.5 349fc1ba5a docs: INV-FMT-RETIRE-001 names the retire as the registry's only writer after start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:54:37 -08:00
pingqiuandClaude Opus 5.5 767d498301 blockmaster: the node registry guard allows the host retire's removal
After start the registry only loses entries: the operator's retire
removes a host that holds no volume, and a retired id is then
unregistered, so the identity checks only get stricter. Adders stay
start-up only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:53:57 -08:00
pingqiuandClaude Opus 5.5 9cf074d480 docs: format-gate invariants; v1.1 note: going back works until the format finalize
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:27:56 -08:00
pingqiuandClaude Opus 5.5 647ba06119 master: cluster format level (FORMAT-GATE): reads_level, finalize, level-0 v1.0 semantics, retire
Hosts report the format they read (heartbeat reads_level). The cluster's
format level is the master's attestation file's form: v1.0's bare map is
level 0, the envelope (format 2, format_level 1) level 1.

At level 0 the master keeps v1.0's semantics, so a v1.0.x master started
on the store stays safe: renewals clamp to the persisted horizon and an
extender keeps it current; forced moves and re-grants wait for the later
of horizon and deadline plus skew; records are envelope version 1.

sw-block cluster finalize-format raises the level in one durable step
(the envelope write), refused while a registered host has not reported
that it reads level 1; then the publisher switches under both its locks.
At any level no new work goes to a host that reads below it; its
heartbeat is refused binary_too_old; every assignment carries the level.
sw-block cluster retire-host removes a host that holds no volume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:27:53 -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
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 061a8cd302 Merge branch 'main' into fix/head-version-v11 2026-12-01 16:10:52 -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
Ping Qiu 18d80d93e7 Merge branch 'main' into fix/head-version-v11 2026-12-01 15:40:18 -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 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 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
Ping Qiu 06a044d368 Merge pull request #890 from seaweedfs/feat/hostlimit-fetch-cap
hostlimit, storage: cap chunk fetches per host
2026-12-01 14:10:04 -08:00
pingqiuandClaude Opus 5.5 3311545b14 authority: the lease deadline keeps its monotonic reading
A renewal's grant stays a time.Time (now+TTL with its monotonic reading)
for the deadline admission compares; only the reply carries wall
nanoseconds. The revoke ACK checks validity against that deadline the same
way. A missing deadline reports expiry 0 (no host validity), and comments
tell the deadline (restart + TTL) from the barrier (deadline + skew).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:03:04 -08:00
pingqiuandClaude Opus 5.5 a8d2a6e6c6 authority: renewals write nothing; waits use the master's own deadline; records are version 2
A renewal grants now+TTL from memory and writes nothing: the persisted
horizon, its clamp, its background extension and its counters are gone.
A forced move, an expired re-grant and a delete's no-live-lease proof wait
for this process's deadline plus skew (its latest grant, or after a
restart the restart floor it already set at load); no lease value an
earlier process wrote is read. An authority record's envelope is now
version 2, which a v1.0.x master refuses (it would trust the record's
stale lease expiry); this master reads versions 1 and 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:55:23 -08:00
Ping Qiu 4b96d9940b Merge pull request #892 from seaweedfs/test/hostlimit-window-bound
hostlimit: test, the no-progress window bound starts at the admission
2026-12-01 12:59:54 -08:00
pingqiuandClaude Opus 5.5 204c2132f2 authority: the line index check is exact both ways
Every per-volume read in the package's tests now checks the whole index
against the whole state: every state key indexed, every indexed key in the
state, no empty volume set, and the read equal to the scan. Negative
controls: a stale extra entry, a missing entry, an empty set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:46:08 -08:00
pingqiuandClaude Opus 5.5 975628e853 hostlimit: test, the no-progress window bound starts at the admission
The window's timer starts inside Admit; a first admission publishes and
syncs the host configuration, which a loaded runner can stretch to
hundreds of milliseconds. The upper bound is now measured from Admit's
return; the lower bound still from before it. The failure message prints
the admission's duration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:39:46 -08:00
pingqiuandClaude Opus 5.5 d7377311f2 hostlimit: fetch test ownership and the waiting-path control
- The fetch child keeps its release (and so the slot's file) reachable
  while it lives, with forced collections before it reports HELD.
- The ended-waits test registers every release at once, and its second
  half frees the other slot only once each fetch is already waiting, so
  the waiting path's success is what is checked.
- The competing fetches derive from a cancellable context, and cleanup
  joins them within a bound.
- Comments: one fetch polls per limiter (blockvolume makes one per
  process); a configuration check in progress can add its bounded guard
  wait after the context ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:32:20 -08:00
pingqiuandClaude Opus 5.5 1febcbcedb authority: a per-volume line index; a call reconciles only its volume's bindings
The publisher indexes its lines by volume, kept by the one writer of its
state, so every per-volume read (the workspace line, the authority line,
the bound replica, the published epoch, the promotion basis) costs the
volume's replicas, not every line. A register, ACK or move reconciles the
bindings of its own volume and of any volume whose reconcile failed before;
the start still reconciles every volume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:24:19 -08:00
Ping Qiu 4063be8def Merge pull request #888 from seaweedfs/test/v11-golden-bytes
storage: golden bytes for the v1.1 record, pass cursor and coverage map
2026-12-01 12:22:08 -08:00
pingqiuandClaude Opus 5.5 ea127a0181 hostlimit: fetch waits are non-blocking, checked and bounded
- A limiter's first fetch checks the host configuration under
  configuration.lock, publishing it when absent (configGuard, now shared
  with cut admission): a fetch-only process with other flags gets ErrConfig.
- No blocking lock: with every slot held, one fetch per process polls
  every slot each 20 ms (the others wait for its turn, within their
  context). An ended wait leaves no lock request, descriptor or goroutine;
  lockBlocking is removed.
- The waiting is unordered and bounded by the caller's context alone; the
  docs say so instead of promising a kernel queue.
- A slot taken when the context has already ended is given back, with the
  context's error.
- INV-HOST-FETCH-CAP-001, M7 and the v1.1 note state the contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:20:40 -08:00
pingqiuandClaude Opus 5.5 2d2e05ba43 hostlimit: red tests, fetch config check, ended waits and handoff cancel
- A fetch-only start must publish and check the host configuration: a
  child process with FetchSlots 2 fetches first, and a FetchSlots 1 fetch
  must answer ErrConfig (fails: no configuration is published).
- Waits that end at their deadline, or by taking another slot, must leave
  no goroutine or descriptor behind while their slot stays held (fails: 40
  blocked lock waits remain).
- A context that ends as a slot is taken must get its error, slot given
  back (fails: the slot is handed over). Seam: testFetchLocked.
- Controls: a killed child's slot is freed; a waiter passed by others ends
  by its deadline (the waiting is unordered, bounded by the context).
- The same-process cap test is renamed AcrossLimiters; holdAsync joins and
  releases its wait in cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:11:54 -08:00
pingqiuandClaude Opus 5.5 5a57e8564d hostlimit, storage: chunk fetches are capped per host
- hostlimit: Config.FetchSlots (default 64, files fetch-0..N-1 in the pool).
  HoldFetch takes a free slot without waiting, from the key's hash slot;
  with every slot held it blocks on its hash slot (the kernel queues the
  waiters) and tries the other slots every 20 ms, using whichever lock comes
  first and releasing the other; its context bounds the wait, and a lock got
  after that is released at once. lockBlocking on Unix and Windows.
- storage: BudgetFetch; fillOnce holds one slot across its remote read only
  (a read miss and a hydrate-all fill alike); a context error on the wait is
  the hydration path's pending, as before.
- blockvolume: --host-limit-fetch-slots. Invariants: INV-HOST-FETCH-CAP-001;
  M7 states it. v1.1 notes carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:52:37 -08:00
pingqiuandClaude Opus 5.5 9391166b25 hostlimit, storage: red tests, a per-host cap on chunk fetches
Seams: Config.FetchSlots (default 64), fetchSlot (a key's hash slot),
Limiter.HoldFetch (no cap yet) and storage.BudgetFetch.

- TestHoldFetchCapHoldsAcrossProcesses: with every slot held by other
  processes, a fetch waits until one is released, then takes it. Fails here.
- TestHoldFetchAWaiterThatGivesUpLeavesNoSlotHeld: a waiter past its context
  returns the context's error, and a slot it gets after is released at once.
  Fails here.
- TestHoldFetchTakesAnotherSlotThatFreesFirst: a waiter behind a slow holder
  of its own hash slot takes another slot within one retry interval of its
  release. Fails here.
- TestHoldFetchTakesAFreeSlotAtOnce: a fetch with a free slot does not wait
  (holds here, must keep holding).
- TestChunkFetchHoldsAHostSlotAroundItsRemoteRead: a chunk fetch holds one
  slot exactly across its remote read. Fails here: none is held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:43:59 -08:00
pingqiuandClaude Opus 5.5 32f9366542 ci: vet and test each lab tag alone and both together
The draft v1.1 format tag is now separate from the 256 GiB cap lift, so
the lab-tag step builds and tests swblock_lab_bigvol, swblock_v11_format
and both, and runs the format-tag test under each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:16:50 -08:00
Ping Qiu cf31d2ec4e Merge pull request #396 from seaweedfs/feat/host-tickets
hostlimit: timer cuts wait in ticket order; pacing uses the budget over held slots
2026-12-01 11:16:06 -08:00
pingqiuandClaude Opus 5.5 f230a1678d storage: golden bytes for the v1.1 record, pass cursor and coverage map
The chunk record's page and header, the upgrade pass cursor, and the
coverage map's two leaves, index page and root are pinned byte for byte:
each encodes to its fixture, each fixture decodes to its input, and the
fixtures are pinned by SHA-1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:13:54 -08:00
pingqiuandClaude Opus 5.5 73ec053d7f build: the draft v1.1 store format gets its own tag, apart from the cap lift
swblock_v11_format now turns on the draft v1.1 store format;
swblock_lab_bigvol lifts only the create cap and the headroom refusal.
A build with the format tag names itself in its revision
("LAB BUILD(swblock_v11_format)"), so the image refusal keys on it as it
does on the cap tag, and the CI tag check refuses either tag outside its
allowlist. CI tests each tag alone and both together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:12:42 -08:00
pingqiuandClaude Opus 5.5 970d925fce durable: a requeued turn stays at the back until a cut succeeds
requeue is set by an admitted attempt that fails and cleared only by a
success: a wait, a refusal or a dropped ticket (a reconcile, a pause) leaves
it set, so every later ticket of the turn is taken at the host's now.
INV-HOST-TICKET-REENTRY-001 states it and names the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:54:03 -08:00
pingqiuandClaude Opus 5.5 cecdc3e858 durable: red test, a requeued turn stays at the back across a wait and a drop
TestChunkLoop_ARequeuedTurnStaysAtTheBackAcrossAWaitAndADrop: a cut admitted
on its ticket fails, its retry waits (not the head) on a tail ticket, and a
reconcile then drops it; the next ticket must not be earlier than the tail
one. Fails here: an unadmitted result clears requeue, so the new ticket is
back at the schedule's old due time, ahead of the cuts that queued meanwhile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:54:03 -08:00
pingqiuandClaude Opus 5.5 1a3ab72b7d hostlimit, durable: ticket order holds on retry and refusal
- the cut loop: an attempt admitted on its ticket that then fails retries on
  a fresh ticket at the back of the queue (the host's now), never at its
  schedule's earlier due time; a failed ticket creation is a wait (no cut,
  the reason in status, the next poll tries again), never an un-ticketed cut.
- the limiter: an urgent admission refused after taking its urgent-pending
  hold closes the hold, so no Normal admission stays refused for it.
- tests: the new concurrent tests and the ticket tests end their workers
  with a bounded join on every path, a failing assertion too.
- invariants: INV-HOST-TICKET-REENTRY-001; the urgent row names its test.

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