Commit Graph
297 Commits
Author SHA1 Message Date
pingqiu 93d8e6cce9 Merge main and preserve detach fast-poll and urgent cut admission 2026-11-20 05:23:19 -08:00
pingqiuandClaude Opus 5.5 3de728e23d Clear lease stop-pending when a detach aborts and serving resumes
A detach whose final cut provably did not publish resumes serving, but
the stop-pending mark set at the start of the detach stayed latched on
the host and on its lease guard, so a host that kept serving renewed
about four times a second for good instead of once per renewal delay.

The detach hook now returns an attempt token, and the provider calls a
second hook with that token only after it resumed serving on a proven
abort. The host clears stop-pending, on itself and on its guard, only
for the latest attempt, so an older attempt's resume cannot clear a
newer pending detach; an applied, fenced or unknown outcome keeps it.

Tests: the guard's sleep is now observable through a scheduling seam,
so the cadence test asserts the delay chosen after each renewal and the
kick path separately, with no wall-clock window; the detach hook is
witnessed before the drain starts; test workers are joined, bounded and
failing on timeout, before their providers are closed. The invariants
document gains the StopPending mode of the lease guard (scheduling
only, no admission or ACK change) and INV-WS-STOP-PENDING-001. Comments
now say that 250 ms bounds the sleep after a completed renewal, not the
time from a revocation to its ACK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:17:44 -08:00
pingqiuandClaude Opus 5.5 c0297da05a Poll the workspace lease fast once a detach starts
On a graceful stop the chunk layer is detached first and the master marks
the lease revoking right after, but the host's lease guard only learned of
the revocation on its next renewal, up to 10 s later (3-6 s measured), and
the guest's writes were refused all that time.

A detach now calls an optional provider hook, OnChunkDetach, which the
blockvolume host connects to its lease guard: the guard renews at once and
then every 250 ms until it fences. The pending mark is never cleared; a
detached host does not serve again under the same guard. The hook fires
only on the detach path, not on the lease-fence StopIO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:17:28 -08:00
pingqiu 6f771c8169 durable: wire opt-in pre-copy into settled detach lifecycle 2026-11-20 03:43:25 -08:00
pingqiu 3eda912af8 fix: scope upload pacing and degraded cut admission honestly 2026-11-20 02:41:45 -08:00
pingqiu b621337dc6 Merge remote-tracking branch 'origin/main' into feat/host-cut-limiter
# Conflicts:
#	docs/design/invariants.md
2026-11-20 02:38:04 -08:00
Ping Qiu e6c74a55bc Merge pull request #285 from seaweedfs/feat/blockvolume-single-filer
blockvolume: refuse to start unless the chunk filer is the only filer
2026-11-20 01:37:09 -08:00
pingqiuandClaude Opus 5.5 961f08f66e chunkstore: the single filer must be the configured one, on every master
A pass now needs a master listing exactly the configured filer (same
gRPC port, same or co-resolving host). Every master is asked: any
master listing another filer or several refuses at once, whichever
answers first. Each master call is bounded within the remaining time,
so a stalled master no longer consumes the whole bound. Startup census
only; invariant INV-WS-SINGLE-FILER-001 and its M6 row record it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:53:13 -08:00
pingqiuandClaude Opus 5.5 a5785ff688 blockvolume: refuse to start unless the chunk filer is the only filer
Block metadata needs exactly one filer behind --chunk-filer. At startup
the chunk wiring asks that filer for its masters and filer group
(filer_pb.SeaweedFiler/GetFilerConfiguration), then the masters for the
filers of that group (master_pb.Seaweed/ListClusterNodes). It refuses
unless a master lists exactly one, and when it cannot get that answer
within 15 s. The filer subset gains GetFilerConfiguration and a master
subset carries ListClusterNodes, generated with the committed plugin
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:20:10 -08:00
pingqiuandClaude Opus 5.5 26e34b6b9a test: expect the profile dir refused where SIGUSR1 is missing
On platforms without SIGUSR1 a set --cpu-profile-dir is refused in flag
parsing; the default (off) stays common to all platforms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:57:18 -08:00
pingqiuandClaude Opus 5.5 fb939adb8a blockvolume: validate the profile dir before startup; stop joins the worker
parseFlags refuses an unusable --cpu-profile-dir (and a platform without
SIGUSR1) before run() activates anything; the handler is installed at
the top of run(). stop removes the handler, stops and joins the signal
worker, then writes out a running profile, so a buffered SIGUSR1 cannot
start a profile after it. Tests decompress the whole profile and check
that no profile runs after stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:47:25 -08:00
pingqiuandClaude Opus 5.5 39f011555a blockvolume: opt-in CPU profile toggled by SIGUSR1
--cpu-profile-dir (default $SWBLOCK_CPU_PROFILE_DIR) names an existing
directory; SIGUSR1 then starts a CPU profile written there as
blockvolume-<pid>-<n>.pprof and the next SIGUSR1 stops it. Shutdown
writes out a running profile. Unset (the default), nothing is installed
and blockvolume is unchanged. No port is opened, so a harness can
profile any running volume with kill -USR1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:36:05 -08:00
pingqiu 76445f968e fix: reject ignored or invalid host limiter configuration 2026-11-19 23:04:56 -08:00
pingqiu 7ba1172b9a feat: isolate background fill and idle admission pools 2026-11-19 22:59:13 -08:00
pingqiu b1ecbee969 feat: coordinate host cut budgets with shared file-lock slots 2026-11-19 22:53:20 -08:00
pingqiu 5f68c2251b blockvolume: add a soft memory ceiling and process memory status 2026-11-19 20:16:34 -08:00
pingqiuandClaude Opus 5.5 951fa7985e test: the four reproductions skip unless SEAWEED_KNOWN_BUGS=1 (#186 #187 #188 #189)
Each names its open issue; the fix PR removes its skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:11:08 -08:00
pingqiu 48527ef2ce Merge remote-tracking branch 'origin/main' into test/oss-four-findings 2026-11-19 18:09:31 -08:00
pingqiu 731f278542 storage: fail rebuild snapshots on read faults and preserve RMW fencing 2026-11-19 16:03:15 -08:00
pingqiu 39aca2daee storage: expose configurable hydration limits and wait/fetch counters 2026-11-19 16:03:09 -08:00
pingqiu 13281568ef test: require configurable hydration worker and queue limits 2026-11-19 16:02:10 -08:00
Ping Qiu ecc1a6ef64 Merge pull request #256 from seaweedfs/feat/chunk-manifest-format3
feat(chunkstore): version chunk manifests with encoding and birth frontiers
2026-11-19 14:34:43 -08:00
Ping Qiu 9a0d432b6a Merge branch 'main' into feat/chunk-manifest-format3 2026-11-19 07:10:21 -08:00
Ping Qiu 3b0ca337c0 Merge branch 'main' into feat/dtb-b2-forced-lost-range 2026-11-19 07:10:12 -08:00
Ping Qiu 1747cdf9e1 Merge pull request #258 from seaweedfs/feat/dtb-b3-volume-unheld
storage, sw-block: prove locally that no process holds a volume
2026-11-19 06:37:59 -08:00
Ping Qiu 83b0878864 Merge pull request #229 from seaweedfs/fix/chunk-refuses-replication
blockvolume: refuse replication on a walstore-chunk volume (RF1 only)
2026-11-19 06:34:38 -08:00
pingqiuandClaude Fable 5.2 9853ea8f10 Merge branch 'main' into fix/chunk-dirty-threshold-help
Resolve the conflict in the ProviderConfig comments: keep main's new DetachFreezeTimeout field and the corrected ChunkDirtyThreshold comment.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 03:06:52 -08:00
pingqiuandClaude Opus 5.5 ffb5cbbe4e authority: every store records lost ranges; a resumed reservation needs its range
Fold of the #255 r2 review:
- the lost-range methods are part of AuthorityStore instead of an
  optional capability, so no store (and no wrapper embedding one) can
  issue a forced move without recording its range;
- a pending forced reservation resumes only with the exact range recorded
  before it; a missing one is refused, never recomputed (a new request
  records a fresh range);
- fault hooks inside the file store cover a failure before the rename and
  one at the directory sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 03:05:07 -08:00
Ping Qiu fe3fe97489 Merge branch 'main' into fix/chunk-refuses-replication 2026-11-19 03:05:05 -08:00
pingqiuandClaude Opus 5.5 fcf5dc72d7 storage: decide unheld on one locked descriptor
Fold of the #258 review:
- the probe opens the volume once, locks that descriptor first, then
  identifies the same open file as v3: a path replaced between two opens
  can no longer yield a false unheld, and a locked file is held whatever
  it is;
- locking before reading also fixes Windows, where an owner's byte lock
  refused the probe's earlier read (it reported unknown, not held);
- the test reaps its holder process on every path; the CLI test closes
  its store unconditionally;
- the usage text adds that the probe is momentary and reserves nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 02:49:51 -08:00
pingqiuandClaude Opus 5.5 28f983bb4c storage, sw-block: prove locally that no process holds a volume
ProbeVolumeUnheld takes and releases the exclusive, nonblocking advisory
lock that every v3 owner holds while its store is open; the kernel drops
it when the owner process exits. nil means no process on this host holds
the volume; ErrVolumeHeld means one does; anything else is unknown (a
non-v3 file is refused: its owner would not take the lock).

`sw-block ops volume-unheld --path P` exits 0 only when unheld (1 held,
2 unknown). The proof is per host and for local filesystems only; host
cleanup must also check that the owner process is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 02:25:50 -08:00
pingqiu a8eab7b361 test: prepare versioned manifests for catalog caller fixtures 2026-11-19 01:45:07 -08:00
pingqiu 608046e6cb fix: refuse missing open-only volumes before fresh sidecars 2026-11-19 00:33:10 -08:00
pingqiu 4055e403ea test: cover open-only geometry and disappearance race 2026-11-18 23:38:06 -08:00
pingqiu d102a1c1a3 fix: admit geometry only when creating durable storage 2026-11-18 23:37:14 -08:00
pingqiu 1e5fe198e3 test: preserve existing-volume create-geometry compatibility 2026-11-18 23:36:38 -08:00
pingqiuandClaude Fable 5.2 3e6e0c9603 blockvolume: correct the --chunk-dirty-threshold help text and comment
The flag help and the ChunkDirtyThreshold comment still described the
cut as it was before copy-before-write: "bound on one cut's barrier
copy" and "0 = unbounded".

Since the chunk copy moved out of the barrier, the value is the number
of candidate chunks above which a cut pre-copies (stages) chunks before
its barrier, in rounds of that size, and 0 disables pre-copy
(chunk_layer.go, stage: a bound <= 0 returns without staging).

Text only. No behaviour change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-18 23:13:32 -08:00
pingqiu a9a2cfa936 style: group create-admission imports 2026-11-18 23:10:20 -08:00
pingqiu 9e809120f4 fix: admit original geometry before every durable create 2026-11-18 23:08:47 -08:00
pingqiu c4a37fd4a0 test: cover create admission callers and legacy retry 2026-11-18 23:07:15 -08:00
pingqiuandClaude Opus 5.5 f7e0823fc3 volume: bind the RF1 refusal to its epoch
Review fold (P1): the refusal had no epoch, so RF1@2 -> RF2@3 refused ->
a stale RF1@2 replay cleared it and reopened the old healthy view. The
host now records the highest refused epoch; an RF1 fact below it is stale
(not adopted, refusal kept), and the refusal is cleared only after the
role fence of a current-or-newer RF1 fact succeeds, never by a failed
attempt. Test with a real backend write schedule; ingress rows for legacy
and dual-lane, and no listener after the RF1 primary role.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:03:24 -08:00
pingqiuandClaude Opus 5.5 90ecf57c28 blockvolume: install the RF1 rule in the host before any fact is applied
Review fold (P2): SetReplicationVolume replays a retained RF2 fact before
SetSelfFence installs the ingress gate; with no self fence the host could
install the peer set, adopt and emit readiness. The rule now lives in the
host config (RF1Only, from hostConfig at construction): every fact with
replica slots, primary with peers or supporting replica, is refused before
UpdateReplicaSet, adoption or the ready marker, and latched as a role
admission failure; an RF1 fact clears it. The ingress gate stays as the
second layer. Tests: the start schedule (blocked readiness, stored RF2 fact,
replay with no self fence), supporting refusal, RF1 recovery, unset control;
ingress refusal with dual-lane on both ports, classified by
ingressPortReleased; hostConfig wiring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:17:28 -08:00
pingqiuandClaude Opus 5.5 14282cb975 blockvolume: refuse replication on a walstore-chunk volume
A chunk cut takes its LSN from the local WAL head, which no replica is
guaranteed to hold, so a published HEAD could be ahead of every replica.
The master's workspace RPCs enforce RF1; a direct start did not.

- start: --durable-impl=walstore-chunk with --replication-ack sync-quorum or
  sync-all is refused at flag parse.
- assignment: the replication factor arrives with the assignment, so the
  ingress role gate of a walstore-chunk volume refuses every role with replica
  slots (replica, primary with peers) without opening a socket; the host's
  existing role-admission latch keeps the role unadopted and not Healthy. A
  primary without peers (RF1) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:00:32 -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
pingqiuandClaude Opus 5.5 6896463a44 volume: name the cause when the workspace lease guard fences
The guard fenced silently: when renewals kept failing until the lease
expired, it drained the volume through blockvolume's lease-stop path, which
logged nothing, and returned the raw RPC error (issue #205).

- Every fence records its first cause: lease expired without a successful
  renewal, expired after a failed renewal (with the renewal's latency and
  error), an invalid reply, a reply that arrived after the deadline,
  revocation by the master, or shutdown. The guard logs it once as
  "workspace lease: fenced ...", FenceCause() returns it, and the non-ACK
  drain error carries it.
- Every failed renewal is logged with its latency and the lease deadline,
  also when the lease is still valid: a run of them is the warning before
  an expiry fence.
- An expiry after a failed renewal returns "workspace lease expired:
  renewal failed after <d>: <err>", wrapping the RPC error.
- blockvolume logs when it stops because the guard requested the drain.

The fence behaviour itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 03:50:08 -08:00
pingqiu a81bca4926 feat(storage): activate mapped v3 through the production storage callers 2026-11-18 03:49:47 -08:00
pingqiu f578d109b5 fix(sparrow): bound repeat cleanup to the actual map file format 2026-11-18 02:37:27 -08:00
pingqiu eb14704197 fix(sparrow): clean the owned persist demo map on repeat runs 2026-11-18 02:25:34 -08:00
pingqiu 833a97925f fix(storage): hold the creator lock through descriptor publication and ownership transfer 2026-11-18 02:04:10 -08:00
pingqiu 0fe8b00efc fix(storage): exclude offline migration from v3 open owners 2026-11-18 01:00:15 -08:00