Commit Graph
1968 Commits
Author SHA1 Message Date
Ping Qiu c628c09e59 Merge pull request #290 from seaweedfs/feat/master-journal-isolation
master: detect a shared authority journal; lease headroom alarm
2026-11-20 09:23:24 -08:00
Ping Qiu 41142f96ba Merge pull request #283 from seaweedfs/feat/retire-v2-local-format
storage: retire the legacy v2 local engine
2026-11-20 09:23:08 -08:00
pingqiuandClaude Opus 5.5 8ac890e0cd Merge main (a1c28e6d) into the v2-retirement branch
Conflicts were only between the v2 removal and the sync policy from #286:
- wal_writer.go: stays deleted (no v3 code uses walWriter); #286's change there applied only to the v2 writer.
- walstore.go, legacy create/open constructors: stay deleted.
- walstore.go, openInitializedV3: keeps the v3 signature and the unconditional init, and takes #286's newDataFileSync for both the WAL and extent syncs.

The two plain f.Sync() calls that main has and this tree drops are in the legacy create constructor and the legacy superblock writer, both removed with v2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:17:39 -08:00
Ping Qiu a1c28e6d99 Merge pull request #286 from seaweedfs/experiment/wal-fdatasync
fix(storage): default Linux data sync to fdatasync with sparse creation
2026-11-20 08:09:43 -08:00
Ping Qiu 653b112f5a Merge pull request #296 from seaweedfs/fix/move-grant-starts-lease
authority: an issued move starts the new holder's lease; forced moves can re-assign an unclaimed grant
2026-11-20 08:09:34 -08:00
Ping Qiu f2f22bb8ce Merge pull request #293 from seaweedfs/fix/recovery-event-dedup
fix: deduplicate recovery observations and reject cross-session stale writes
2026-11-20 08:09:25 -08:00
pingqiu 4261e3cd0a Merge remote-tracking branch 'origin/main' into experiment/wal-fdatasync 2026-11-20 06:45:47 -08:00
pingqiu 5a50d30ddd fix(storage): validate creation policy before file ownership and settle sync helpers 2026-11-20 06:38:01 -08:00
pingqiu 33904ff61d test(storage): expose create-policy side effects and sync control lifetime gaps 2026-11-20 06:36:11 -08:00
pingqiu 802b159c9f test(storage): distinguish sparse volume space from initialized WAL 2026-11-20 06:24:59 -08:00
pingqiu ccd94bd232 docs(storage): align data sync and sparse creation contract 2026-11-20 06:23:32 -08:00
pingqiu a1ce2a4d9e fix(storage): default Linux data sync to fdatasync and retain sparse creation 2026-11-20 06:22:34 -08:00
pingqiu 0b5a980bc8 test(storage): require sparse creation and refuse fallocate policy 2026-11-20 06:21:58 -08:00
pingqiu db07ef2c16 docs: align replica lifecycle and promotion guard models 2026-11-20 05:23:15 -08:00
pingqiuandClaude Opus 5.5 f1c1a0942c Merge main (#291) into the grant-lease branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:20:48 -08:00
pingqiu 704eedac67 fix: guard promotion readiness and retire settled replica sessions 2026-11-20 05:17:12 -08:00
pingqiu 61274080b0 test: reproduce false readiness and retained settled replica coverage 2026-11-20 05:17:12 -08:00
pingqiu 7261411c46 docs: state prefix provenance and remaining healthy-run bound 2026-11-20 05:17:12 -08:00
pingqiu 8bd459c24a fix: require a covered starting image before extending replica prefix 2026-11-20 05:17:12 -08:00
pingqiu 78781527ae test: bind wire pruning assertion to its actual recovery session 2026-11-20 05:17:12 -08:00
pingqiu 7b2522b485 test: refuse prefix certification from plain healthy probes 2026-11-20 05:17:12 -08:00
pingqiu ed08492b87 test: specify certified prefix pruning and recovery coverage guards 2026-11-20 05:17:12 -08:00
pingqiu 85bf19a8bb fix: prune replica versions only behind certified recovery prefixes 2026-11-20 05:17:12 -08:00
pingqiu 28d3054de5 test: preserve lane semantics after durable version pruning 2026-11-20 05:17:12 -08:00
pingqiu 0a95b53940 test: keep long-run source versions monotone 2026-11-20 05:17:12 -08:00
pingqiu bc1b0fbaeb test: expose replica version history growth and recovery holes 2026-11-20 05:17:12 -08:00
pingqiu 54c1c61156 test: cover both post-close recovery decisions and settle the latest session 2026-11-20 05:17:12 -08:00
pingqiu 4987a49d31 fix: emit one recovery action per post-close durable acknowledgement 2026-11-20 05:17:12 -08:00
pingqiu 68da02fb5f fix: preserve missing probe confidence with retained durable progress 2026-11-20 05:17:12 -08:00
pingqiu 364118a28e fix: deduplicate recovery observations and share replica apply versions 2026-11-20 05:17:11 -08:00
pingqiu 056c80a957 test: expose missing production replica apply-gate wiring 2026-11-20 05:16:51 -08:00
pingqiu 14d724e3de test: witness an admitted old wire frame overtaken by a newer session 2026-11-20 05:16:51 -08:00
pingqiu 67e0cf0bbe test: pin duplicate recovery preparation and delayed probe schedules 2026-11-20 05:16:51 -08:00
pingqiu c400b28f5f test: reproduce cross-session replica byte regression 2026-11-20 05:16:51 -08:00
pingqiuandClaude Opus 5.5 f9b8487012 Guard the issued lease publication as one lease-lock hold
The behavioural test runs its renewal after the publication helper
returns, so a helper split into two lease-lock sections (refresh the
view, then set the deadline) still passes it: nothing in the gap
between the sections can be intercepted without a production hook.
Add a source-structure guard, like the existing non-forgeability scan:
the helper takes the lease lock exactly once, holds it to return,
assigns both the derived view and the deadline under it, and calls no
other publisher method that takes the lease lock, directly or
transitively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:14:30 -08:00
Ping Qiu 8a603b3334 Merge pull request #291 from seaweedfs/feat/lease-fast-poll-on-detach
blockvolume: poll the workspace lease fast once a detach starts
2026-11-20 05:02:06 -08:00
pingqiuandClaude Opus 5.5 199bb65fc6 Publish the issued lease atomically and accept any older-epoch HEAD
A move issue published the new epoch's lease view and then, in a
separate lease-lock section, replaced the deadline with issue + TTL. A
renewal of the new epoch landing between the two raised the deadline,
and the issue then lowered it under the outstanding grant, so later
renewals inside that grant were refused. The view and the initial
deadline are now published in one section, and the issue never lowers a
deadline.

A forced move now accepts any HEAD at an epoch below the expected one,
read after admission, with the lost range from that HEAD's RemoteLSN.
Requiring the HEAD generation and LSN recorded at the issue refused the
volume for good when an earlier holder's in-flight claim landed after
the next move was issued and that move's holder then died unclaimed. A
HEAD at the expected or a higher epoch that is not the expected holder's
is still refused; clean moves are unchanged.

Comments now say what admission guarantees: the expired holder starts
no new claim or cut, but a claim already sent may still land. The
paused-holder test witnesses the refused attach decision instead of
watching HEAD for a fixed time, and the design document and invariants
record the issue-to-lease transition, the forced HEAD rule and the open
model check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:47:11 -08:00
pingqiuandClaude Opus 5.5 da5e51b8a3 Merge main into retire-v2-local-format
Resolves the one conflict in docs/design/invariants.md: keeps main's
INV-WS-HEAD-BELT-001 and INV-WS-HEAD-CAS-001 rows, and lists the union
of both sides' tests for INV-WS-HEAD-MONOTONE-001.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:19:30 -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
Ping Qiu a6aeb99e0c Merge pull request #280 from seaweedfs/feat/host-cut-limiter
feat: coordinate host background cuts with shared budget slots
2026-11-20 04:13:31 -08:00
pingqiuandClaude Opus 5.5 fe0cd8448c Start the new holder's lease when a workspace move is issued
A move issue cleared the lease and the new holder's lease was created
only by its first renewal. A holder that died between its grant and its
first renewal left the volume with no lease, so no move was ever
admitted again, not even a forced one. A holder that died after renewing
but before claiming HEAD was stuck too: HEAD still named its predecessor
and the forced move refused it.

The issue write now starts the new holder's lease (horizon issue +
1.5*TTL, granted deadline issue + TTL, the same values a first grant
uses), so an unclaimed grant expires like any other lease and a forced
move is admitted after that lease's expiry plus the skew bound, never on
a predecessor's lease. The holder's first renewal is an ordinary renewal
of that lease, with no extra write.

A forced move also accepts a HEAD that still names the predecessor when
it is unchanged since the move to the expected holder was issued (same
generation and remote LSN, older epoch). Clean moves are unchanged.
Blockmaster reads HEAD for a forced move only after its lease admission
holds, so the HEAD the move and its lost range rest on can no longer be
changed by the expired holder. A holder resuming after the forced move
is refused at attach by its lease-gated projection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:10:03 -08:00
pingqiuandClaude Opus 5.5 59331e8cf1 docs: describe extension write latency as completed-write telemetry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:57:46 -08:00
pingqiuandClaude Opus 5.5 13cc62b992 feat: report extension write latency and compare file system ids
The lease extension's durable store write is timed around the write
alone and recorded under the lease lock: the latest duration and the
slowest of the last minute (rolling, one bucket per second, like the
clamp counter). LeaseStats and the status endpoint carry them
(extension_write_last_ms, extension_write_max_last_minute_ms; -1 before
the first write, or with none in the last minute). Write latency is the
early lag signal; the headroom alarm and clamps follow it.

Storage identity gains statfs f_fsid (Linux). Two identities that both
know it must agree on machine id, device and fsid; when either side's
fsid is unknown (an older reporter, a platform without statfs) the
comparison falls back to machine id and device. Heartbeats carry it in
the new durable_root_fsid field (regenerated with the pinned
generators); the volume host reports it and the master samples its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:47:39 -08:00
Ping Qiu c5bc3f82a1 Merge pull request #288 from seaweedfs/fix/head-takeover-belt
storage: confirm HEAD ownership before serving and settling cuts
2026-11-20 03:36:58 -08:00
pingqiuandClaude Opus 5.5 8358968fd7 fix: replay issued work past strict isolation and bound its observers
Strict journal isolation refuses new work, never an issued decision.
MoveWorkspace now asks the publisher, read-only, whether a request is an
exact replay of an issued move (same id, same validated body) before the
co-location guard; a replay gets its durable grant back, a new id or a
changed body is still refused. PlaceWorkspace keeps the idempotent result
of repeating the recorded placement.

The master samples its authority store's file system after Bootstrap has
created the directory, so a first start detects co-located nodes too.

The heartbeat serving exemption reads the committed authority lines from
the lease views (leaseMu only), with the issued move's target host derived
there, instead of taking the publisher lock held across authority writes.

The headroom alarm fires at the latest with the first clamped grant of a
streak, logged before the clamp line. The per-minute summary is flushed by
the first renewal attempt after the minute, granted or refused.

The status endpoint bounds read, write and idle time, and Close
force-closes connections a timed-out graceful shutdown leaves open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:30:38 -08:00
pingqiu fb1fd8eb2b fix: preserve pool lock faults and clear settled fallback status 2026-11-20 03:15:52 -08:00
pingqiu c57d6747a0 test: cover final fallback release and configuration lock faults 2026-11-20 03:15:04 -08:00
pingqiu 9a88af11f8 Merge main into HEAD belt and retain both invariant rows 2026-11-20 03:05:48 -08:00
pingqiu 3eda912af8 fix: scope upload pacing and degraded cut admission honestly 2026-11-20 02:41:45 -08:00