Commit Graph
4667 Commits
Author SHA1 Message Date
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 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 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 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 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 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
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
pingqiuandClaude Opus 5.5 d17696d1ea master: the line-wake test waits for the grace's rebuild (build 2) before the heartbeat
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:52:35 -08:00
pingqiuandClaude Opus 5.5 db7f6530a3 authority: a counter handshake orders the master's line-wake test
The observation host counts the rebuilds it takes (in the step that takes
the wake) and the rebuilds it finishes, and records when its armed deadline
timer fires, all under its lock; BuildsForTest returns them with whether a
wake is buffered. The master test settles on started == done with no
buffered wake and no timer due, records N, ingests one heartbeat (build
N+1, v1 supported and unbound), and after the controller's publication
requires build N+2 to carry the line: only the hook can take it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:48:58 -08:00
pingqiuandClaude Opus 5.5 2caed63f04 master: the line-wake test waits on a settled observation host, not a sleep
ObservationHost.BuildsForTest reports the builds completed and whether a
wake is buffered or a build is running. The test settles the host before
the heartbeat, requires the heartbeat's build to be a new one, settles
again after the controller's publication, and then requires the line in a
build after that point (or in the settled last build, which can only have
come after the publication).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:41:47 -08:00
pingqiuandClaude Opus 5.5 1cb5e0e124 master: the line-wake test orders its builds so only the hook can wake the last
The test now drains the initial build and the grace's rebuild before the
one heartbeat, whose single wake is consumed by the build showing v1
supported; the controller binds after it, and with no heartbeat, expiry or
GC tick left, the build carrying the line can only come from the hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:36:48 -08:00
pingqiuandClaude Opus 5.5 75bb94c46d authority: the grace's end stays a deadline until consumed; the master's line wake is pinned
NextDeadline keeps the pending grace's end until ExpireDue reports it,
even once past, so a build taken just before it and submitted just after
it is rebuilt with no heartbeat. The property test now fires the host's
timer only at NextDeadline, so a dropped deadline shows. A master test pins
the line-change wiring: a volume reported once is bound by the controller
and the next build carries the line. Comments that promised a wake on
every ingest now say what wakes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:31:26 -08:00
pingqiuandClaude Opus 5.5 ad9ee63491 authority: a heartbeat that changes nothing wakes no observation rebuild
The observation store wakes a rebuild only when an ingest changes what a
snapshot build reads: a new server, a server's facts or freshness, a slot
added, removed or changed but for its timestamps, a slot's expiry state, a
volume two servers report, or a passed deadline. What changes with time is
a deadline: each server's next expiry in a heap, the pending grace's end;
the host wakes at the earliest. A published line wakes the build through
the publisher's line-change hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:15:33 -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