Commit Graph
282 Commits
Author SHA1 Message Date
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
pingqiuandClaude Opus 5.5 e4135b9668 fix(sw-block): refuse bad migration geometry before any write (row 13b P1, P2s)
codex01 review of 7c6a29d8:

- P1: ValidateMigrationV3 lacked the checked extent end, so an aligned
  geometry whose extent end overflows passed, the backup and the map were
  written, and only the slot validation refused. The geometry check now
  applies the same bounds (volume, extent, block, the checked WAL and
  extent ends, the file end within MaxInt64), and the tool runs it, and a
  file-size bound on the v2 WAL, before the WAL is read or anything is
  written.
- P2: the scan allocated the v2 WAL size from the superblock before any
  bound; it is now bounded by the file size first, with no wrapping sum.
- P2: a rerun that found the v2 chunk bitmap already renamed skipped the
  directory fsync an earlier run may have failed; it now fsyncs it.

Controls: an overflowing extent end, a WAL past the file end and a WAL
size whose sums wrap are each refused with no byte written; a retirement
whose directory fsync failed is made durable by the rerun. Mutants: no
checked file end, no file-size bound, the rerun skipping the fsync. The
WAL-region overflow check alone is equivalent: the file-size bound also
refuses that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:22:05 -08:00
pingqiuandClaude Opus 5.5 7c6a29d809 feat(sw-block): sw-block migrate-v3, the offline v2 -> v3 descriptor rewrite (row 13b)
DESIGN r17.4 section 10.1. The tool (cmd/sw-block/migrate.go) runs the
steps, each durable before the next: the read-only exhaustive scan and
the geometry check (a refusal changes no byte), the atomic operator
backup of the v2 superblock, the initial map sidecar (generation 1, every
chunk UNKNOWN, covered = the v2 checkpoint), the prepared slot B at 4096,
slot A at phase 0 (the commit point), slot B at phase 0, then the v2
chunk bitmap retirement, and prints the new descriptor hash. A rerun
decides from the slot bytes alone (the 10.1 table): a v2 A restarts with
a full rescan; a committed A finishes the rollover and the retirement; a
committed B only the retirement; a prepared B with an invalid A refuses
with ErrMigrationIncomplete; neither valid refuses. It never reads or
restores the backup.

core/storage/migrate_v3.go is the tool-only export: it reuses the row-1
slot codec and the row-6 map codec (no second encoder), keeps the extent
base (new WALSize = old - 4096), and opens or serves nothing.

Controls through the actual CLI entry and, tagged, the actual v3 open:
a clean migration (extent unchanged, backup, retirement, the old binary
refuses, an idempotent rerun, v3 serves the v2 blocks with an all-UNKNOWN
map), refusals changing nothing, a crash after each step, the old binary
after preparation, a partly and wholly overwritten prepared B, and the
backup never restored. Mutants: no clean scan, commit before prepare,
retire before the commit, no rollover on rerun, an unrefused incomplete
state, a clean initial map. Not yet: the shared advisory lock (12b) and
committed raw v2 fixtures (13c).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 17:48:10 -08:00
pingqiuandClaude Opus 5.5 d67a6e9179 feat(sw-block): frozen v2 reader and the exhaustive clean-WAL scan (row 13a)
DESIGN r17.4 section 10.1, the read-only half of `sw-block migrate-v3`:
cmd/sw-block/internal/v2legacy holds the frozen v2/impl1 superblock reader
(precondition 2: magic, version 2, walstore, impl version 1; impl 2 is
refused) and the one-record v2 entry probe, so the v3 open code keeps no
legacy reader and row 14 can delete the legacy production code.

ScanClean is precondition 3: it tries the frozen decoder at every byte
offset of the whole WAL region, circularly, and refuses any CRC- and
EntrySize-valid record of a known type whose type-derived footprint fits
the region (38 + Length for write, batch and padding; 38 for trim and
barrier, whose Length is an affected range) and whose last LSN is above
the checkpoint, plus any CRC-valid batch whose count cannot be
classified. Records at or below the checkpoint are ignored. It never
runs recovery or replay and writes nothing.

Controls: every record shape (wrapped, trim range, batch last LSN, zero
count, embedded in a payload, bad CRC) and real v2 stores (cleanly
closed scans clean; synced but never flushed refuses).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:34:40 -08:00
pingqiu 5951a0892d test: record chart, cleanup freshness, and multiblock version findings 2026-11-16 19:17:43 -08:00
Ping Qiu 72eefdbe28 Merge pull request #174 from seaweedfs/feat/walstore-default-smartwal-experimental
blockvolume: walstore is the default for new volumes; smartwal is experimental
2026-11-16 13:41:15 -08:00
Ping Qiu 248f17017e Merge pull request #162 from seaweedfs/chore/scrub-reviewer-names-in-comments
chore: drop reviewer names and ruling timestamps from code comments
2026-11-16 12:47:54 -08:00
pingqiuandClaude Opus 5.5 ba5eeec356 blockvolume: help and README say auto refuses a walstore-chunk root
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:47:04 -08:00
pingqiuandClaude Opus 5.5 1f10755b0e blockvolume: walstore is the default for new volumes; smartwal is experimental
--durable-impl now defaults to empty (auto). A new volume is created as
walstore. An existing volume opens with the implementation its on-disk
superblock names, so volumes created under the old smartwal default keep
opening (no ImplKindMismatch on upgrade). An explicit selector keeps the
exact ErrImplKindMismatch refusal, and an unrecognized on-disk format is
still refused.

- core/frontend/durable: ImplAuto (the zero value) is resolved per volume
  in openOrCreate; openExisting/createFresh take the resolved
  implementation, and each volume handle records it, so DurableStatuses
  reports the on-disk implementation. ImplSmartWAL is documented as
  experimental; the 'production default' comments are removed.
- cmd/blockvolume: --durable-impl default '' with help text 'auto';
  smartwal (experimental). The walstore-only options still require an
  explicit --durable-impl=walstore.
- README: smartwal listed under 'Not claimed yet' with its open issues.

Tests: auto creates walstore; auto opens existing smartwal, walstore and
parallel-walstore volumes by their on-disk format; auto refuses an
unrecognized file; the flag default is empty; explicit values accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:31:27 -08:00
pingqiuandClaude Opus 5.5 48db2739ec ci: add a test workflow (build, vet, go test -short) and harden dead-port tests
- .github/workflows/test.yml, job 'go test (linux)': on pull_request and on
  push to main; Go from go.mod; go build ./..., go vet ./..., and
  go test -short -count=1 -timeout 10m ./... with CGO_ENABLED=0. Actions are
  pinned by commit SHA, permissions are contents: read, and a new push to a
  PR cancels the older run.
- core/ops/surface_test.go: fix the two go vet warnings (resp used before
  the error check), so vet covers the whole module.
- cmd/blockvolume: a withdrawn port no longer has to answer ECONNREFUSED.
  A successful connect still fails; any other dial error passes only if the
  address can be bound again.
- core/host/volume: probe tests dial a listener they opened and closed,
  not the fixed 127.0.0.1:1.
- core/replication/component: on failure, the G5-5C and G9A catch-up tests
  log frontiers, peer status and the engine trace. Assertions and timeouts
  are unchanged.

Test files and the workflow only; no product code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:47:44 -08:00
pingqiuandClaude Opus 5.5 c9273a22be chore: drop reviewer names and ruling timestamps from code comments
Comments in source and tests named individual reviewers and carried the
time a decision was taken (for example "(name's ruling, 06:47Z)"). Those
are review bookkeeping, not design rationale. Remove the names and the
dates/timestamps; keep the rationale, issue and PR references (#51, #82,
#83, #142, #159) and spec section references as plain text.

Comment-only: no code, test logic or string literal changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:39:16 -08:00
Ping Qiu af122ae4e7 Merge pull request #158 from seaweedfs/fix/workspace-lease-clock-skew-157
fix(workspace): separate forced moves with a clock-skew margin
2026-11-16 02:01:14 -08:00
pingqiu 342dc3529a fix: separate workspace lease expiry with a clock skew margin 2026-11-15 23:30:05 -08:00
pingqiu 1bad5dccec Merge main 11f3afe6 into fix/issue51-walstore-midhistory 2026-11-15 23:17:47 -08:00
Ping Qiu 5a9121f762 Merge pull request #153 from seaweedfs/fix/rf1-replication-ingress
fix: gate replication listeners on assigned replica slots
2026-11-15 23:16:10 -08:00
pingqiuandClaude Opus 5.5 e910449f70 storage: RED controls for the #155 review (detection only)
codex01's review of f8d43653 (V:/share/rdma/codex01-block155-review-
20261116T0644Z/REVIEW.md) and claude05's ruling (A), 06:47Z. Against the
reviewed production code (its replay cutoff and positional smartwal
fail-closed; smartwal warning accessors stubbed so the tests build):

- a damaged STALE record in a released range drops retained, synced
  LSN 3 (TestWALStoreRecoverStaleReleasedGarbageKeepsRetainedData);
- a torn smartwal slot accepted by one recovery becomes wal_corrupt
  after a frontier jump and a new sync
  (TestSmartWALTornSlotSurvivesAFrontierJump);
- a smartwal mid-history hole is an outage instead of a warning
  (TestDurableStartup_Issue51_SmartWALHoleIsAWarningNotAnOutage);
- plus codex01's advisory: a healthy primary stays healthy with a
  warning (TestStatusServer_StatusCarriesRecoveryWarnings..., which
  passes either way: the plumbing never forced health).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:04:18 -08:00