Commit Graph
4605 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 e44aba0ed6 storage: a v1.1 cut copies HEAD's chunks for its candidates only
On the v1.1 format a cut's base is HEAD's identity and its candidates'
references (cutBaseLocked), the commit sends identity plus the change set,
and a landed commit is applied to HEAD in place (applyCommitLocked): O(C)
where the base, the proposal and the install each copied every chunk. A
no-op cut compares its captured chunks with the by-change rule less the
generation. The cut's result still reports the whole installed HEAD (one
copy after the settlement, until the flat map goes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:39:30 -08:00
pingqiuandClaude Opus 5.5 b51e59711f storage: a v1.1 commit settles by its change, not whole chunk maps
On the v1.1 format an unresolved commit is found landed by
sameProposalByChange over its change set and the captured chunks it left
as they were (commitMarks), kept beside the pending change set; the v1.0
format and the no-op cut keep the full comparison. A landed commit whose
reply was lost settles although an index it neither changed nor captured
differs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 12:03:14 -08:00
pingqiuandClaude Opus 5.5 ff41808326 storage: a mark may name an absent base (zero chunk equal to nothing)
The cut marks a zero chunk equal to an absent base; marked now takes the
shape of changes (nil: cur must name nothing there), so a landed proposal
with such a mark is judged landed and one where cur names a reference is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:29:36 -08:00
pingqiuandClaude Opus 5.5 0eb8f0e174 storage: sameProposalByChange, the O(C) "proposal landed" decision (not wired yet)
A commit by change landed iff HEAD's generation is past the expected
base, every identity field the full comparison has is equal, every
changed index names the new reference (nothing for a zeroing) and every
candidate the cut marked equal names the base reference its mark
assumed; unchanged, unmarked indices are not compared. The rule is
SegCut's existing decision (no new row). TestSameProposalByChange: each
condition broken alone is not landed, a replay is landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:22:37 -08:00
pingqiuandClaude Opus 5.5 de256fc5aa chunkstore: EachSegment reads HEAD one segment at a time; one segment walker
LayoutRemote.EachSegment is GetHead one segment at a time: HEAD's
identity, and each segment its root names delivered with its shard's
range and references, only one held at a time (for the streaming attach,
V4-B PR 4 commit 4). The manifest read and the attach's bounded read now
share one walker (walkSegments: the root and each segment, counted, each
fetch bounded within an attach).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:27:12 -08:00
pingqiuandClaude Opus 5.5 7e5f1fce7d storage: every HEAD install goes through setHeadLocked; the ref table mirrors it under test
The nine places that installed the layer's HEAD (attach, settlement,
adoption, a fence, a cut's finish) go through setHeadLocked, and a cut's
finish through setHeadChangedLocked, which updates only its changed
chunks. On the v1.1 format they keep the ref table HEAD's when
refTableMirror is on; it stays off until the flat map goes (both at once
only add memory). TestRefTableMirrorsHeadThroughTheLayer runs the cut,
settle, hydration and fill suites on v1.1 with the table on and every
table read checked against the map (a mutant that drops a cut's changes
fails it). Tests that wrote the layer's HEAD directly now install it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:41:21 -08:00
pingqiuandClaude Opus 5.5 5e97bae96f storage: every single-chunk reader of HEAD goes through headRef; the chunkRefs interface
The thirteen readers that looked one chunk's reference up in the flat
HEAD map (the COW window, hydration, clean marks, fill, evict, the shadow's
seed) now ask headRef/headChunk, the one place that still reads the map
by index, so the map behind it can be replaced. chunkRefs declares the
ref table's narrow interface (Get, Set, Delete, FillSegment, Len). No
behaviour changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:57:35 -08:00
pingqiuandClaude Opus 5.5 ce490fdb39 storage: the ref table's fill replaces its segment and refuses out of range; its space test owns its source
FillSegment(first, end, refs) makes a segment's range exactly refs, so a
re-fill drops a reference the new HEAD no longer names; Set and
FillSegment refuse an index beyond the volume or outside the segment
(errRefBeyondVolume) and change nothing, so an attach refuses a malformed
HEAD. The space test drops its source HEAD before the reading, so a table
that aliased its keys would be charged for them (control: a shallow
flat-map copy measures ~287 B/chunk by the same method).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:44:50 -08:00
pingqiuandClaude Opus 5.5 d100675112 storage: the ref table, the holder's fixed-width copy of HEAD's references
refTable keeps one entry a chunk behind Get/Set/Delete/FillSegment/Len:
a canonical layout reference as its full SHA-256 and an interned owner
prefix (the key derived), any other shape kept whole, so it is exact for
every remote. At the 1 TiB chunk count it holds 34 B/chunk, against the
flat map's ~287 with its keys. Not wired yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:40:04 -08:00
pingqiuandClaude Opus 5.5 45f7d71607 storage: the chunk record keeps each chunk's state in one byte
The record runtime held every chunk's kernel state as the kernel's string
kind (16 B a chunk); it now keeps the one-byte page code it already writes
(r2.735) and converts at its boundary through a fixed table. The kernel's
types and table are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:40:04 -08:00
Ping Qiu 15acf340cd Merge pull request #880 from seaweedfs/v11/clean-stop-seed
v1.1 upgrade: seed whole local chunks after a clean stop
2026-12-01 07:30:49 -08:00
pingqiuandClaude Opus 5.5 313d7b7d07 invariants: M1 shows the v1.1 upgrade's guarded clean-stop seed
The diagram gains the Recovering -> Serving edge of the v1.1 attach's
upgrade, and the table its row: whole local chunks Rebuilt all, Hash,
Commit to HP with HEAD's hash only when the clean-stop proof holds (the
claim's own HEAD a committed, idle detach; the store's lineage; the store's
synced position), unknown otherwise; linked to INV-CHUNK-RECORD-SEED-001,
whose machine column now names the same transition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:05:12 -08:00
Ping Qiu 42ba1b9cd0 Merge pull request #879 from seaweedfs/test/v4b-space-baseline
storage: a SPACE baseline at the 1 TiB shape and barrier benchmarks at 1 and 16 TiB
2026-12-01 06:30:39 -08:00
pingqiuandClaude Opus 5.5 cbd442612e v1.1 upgrade: seed whole local chunks after a clean stop
- layout: LocalRoot.ReportCleanStop is told, on each attempt of the claim's
  own check, whether the HEAD the claim is built on is a committed, idle
  detach (DetachedBy) carrying this root's claim id; the committing
  attempt's report is the last. Never judged on Start's first read.
- durable: startLayoutRoot returns that clean stop; the provider carries it
  into ChunkLayerConfig.CleanStop.
- storage: upgradeChunkRecordSeeded seeds only an unmarked store whose
  layout claim id is the proof's and whose synced position (the pages'
  valid-through) is the proof's; the attached HEAD at another position is
  logged and never seeded on. A whole local chunk steps Rebuilt all, Hash,
  Commit and takes HEAD's hash (a chunk HEAD does not name: the zero
  chunk's). The upgrade's order is unchanged.
- invariants: INV-CHUNK-RECORD-SEED-001.
- tests: the attach takes the proof from its config
  (TestV11AttachSeedsFromTheCleanStopInItsConfig); startLayoutRoot reports
  it (TestStartLayoutRootReportsTheCleanStop).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:16:11 -08:00
pingqiuandClaude Opus 5.5 d224873b4b layout: red tests, a start reports the clean stop its claim was built on
A seam: CleanStop and LocalRoot.ReportCleanStop, never called for now.

- TestStart_ReportsTheCleanStopItClaimedFrom: a start at a higher epoch
  on HEAD detached (committed, idle) by this root's lineage reports the
  detach's position, the claim id and the generation. Fails here.
- TestStart_TheCleanStopIsTheClaimsOwnRead: the proof is judged on the
  HEAD the claim's update is built on, its own re-read, not Start's first
  read (a fake store answers the two differently). Fails here.
- TestStart_NoCleanStopWithoutADetachOfThisLineage: a live HEAD, a
  detach with an open session, another lineage's detach and a continuing
  claim report none (holds here, must keep holding).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:07:23 -08:00
pingqiuandClaude Opus 5.5 366d8061a2 storage: the SPACE controls measure the real 1024 blocks a chunk; cleanup on every path
The geometry control now includes 1024 blocks a chunk (a 64 GiB sparse
store): the held heap per chunk is the same as at one block (387 B on
v1.0, 436-439 on v1.1), because the map's wider coverage entry is the
on-disk page format, not the attached heap. The store's cleanup is
registered before the attach, so a failed attach still closes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:06:48 -08:00
pingqiuandClaude Opus 5.5 0442e4cfc7 storage: red tests, the v1.0.x upgrade seeds after a clean stop
A seam: ChunkCleanStop (the proof a start reads before its claim: HEAD a
committed, idle detach of this root's lineage at a position), upgradeSeed
(the proof, the attached HEAD, the zero chunk's hash) and
upgradeChunkRecordSeeded, which ignores the seed for now.

- TestUpgradeSeedsAfterACleanStop: with the proof at the store's synced
  position and the store's own lineage, every whole local chunk is HP with
  HEAD's hash (zero in HEAD: the zero chunk's). Fails here: U.
- TestUpgradeSeedCrashAtEachStep: a crash after the seeded pages and before
  the field rebuilds without trusting them; after the field the marked store
  never seeds; after the header the complete record is used as written.
  The first and last fail here (no seeded pages are written).
- Guards that hold here and must keep holding: no seed when the store is
  above or below the proof (an acknowledged write after the detach; the
  checkpoint position is not the store's), for another or no recorded
  lineage, without a proof, or when HEAD moved since the proof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:02:28 -08:00
pingqiuandClaude Opus 5.5 191a26da50 storage: the SPACE baseline charges the layer for its own canonical keys; its controls
The layer's HEAD now comes from a remote whose GetHead allocates its own
key strings (as a real remote's decode does), so the keys the layer keeps
are counted; the keys are in the layout's canonical form (114 bytes at
the 1 TiB chunk count). TestSpaceMeasurementControls shows a shallow copy
would be undercounted by its keys, that the per-chunk heap does not
depend on a chunk's block count (1, 8 and 32 blocks a chunk agree), and
that key length moves it about one byte a key byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:00:04 -08:00
pingqiuandClaude Opus 5.5 eccc69eb83 storage: a SPACE baseline at the 1 TiB shape and barrier benchmarks at 1 and 16 TiB
TestSpacePerChunkAt1TiBShape reports the holder's heap per chunk after
attach for 262,144 chunks every one named by HEAD (with CHUNK_SPACE_RED=1
it asserts the 200 B/chunk target, red today). BenchmarkCutBarrierScan
and BenchmarkCopyHead time the barrier's idle candidate scan and the flat
map copy at 1 and 16 TiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 05:46:28 -08:00
Ping Qiu 1eed884fe2 Merge pull request #875 from seaweedfs/feat/v4b-pr3b
storage: on v1.1 a cut commits by change; an unresolved one is re-proposed with the same changes
2026-12-01 05:33:40 -08:00
Ping Qiu 7ab755df9a Merge pull request #876 from seaweedfs/fix/log-collect-redaction-fail-closed
log.collect: no artifact is written whose redaction is not proven
2026-12-01 05:06:48 -08:00
Ping Qiu 3df14d3788 Merge pull request #878 from seaweedfs/test/v102-race-fakes
test: two test-only data races (the backup fake, the rebuild test's floorFS restore)
2026-12-01 05:06:00 -08:00
pingqiuandClaude Opus 5.5 09d9c4492b storage, durable: a cut a snapshot rides on keeps its record at INFO; an idle cut stays DEBUG
The previous commit logged every cut attempt at INFO. The rule is every
transition: an idle no-op (no HEAD write) stays at DEBUG, as before, and
a cut that a publication rides on is marked by its caller
(WithPublishingCut): the provider's snapshot marks its cut, so a snapshot
of an unchanged image (a no-op cut, then the snapshot-unchanged HEAD
write) logs the cut's record at INFO. The operator guide is unchanged
from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 05:03:16 -08:00
pingqiuandClaude Opus 5.5 ca37612c51 storage: every cut attempt leaves its publication record at INFO, an idle one included
A cut with no candidate and nothing published (a restored target's first
cut) logged its "cut phases" record at DEBUG only, so at the default
level the attempt left no event. Every attempt now logs it at INFO; the
operator guide says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:53:17 -08:00
pingqiuandClaude Opus 5.5 c3230efc58 log.collect: only a unit command's own failure is unproven; colliding JSON keys withhold
A unit journal read whole with no records in the window (or a command
the host does not have) is only unavailable; only the command's own
failure (cut, nonzero exit, truncated) makes the bundle unproven. Two JSON
keys that collide once sanitized are no longer told apart by a suffix,
which could itself be a known credential and cost quadratic probes: that
artifact is withheld as not proven, checked after its redaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:50:31 -08:00
pingqiuandClaude Opus 5.5 e443057d3a storage: test remotes refuse a change set that differs from the proposal; a census of delta forms
The fake remote and every CASHead-hooking test remote check a commit by
change: HEAD with the change set applied must be exactly the proposal's
chunk map, so a dropped or altered index fails the CAS instead of
publishing a HEAD that lost the chunk (a mutant dropping every index
after the first fails TestV11CutCommitsEveryChangedChunk). A census
requires every type in the package with CASHead or CheckCommit to have
its by-change form (deleting one wrapper's fails it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:43:35 -08:00
pingqiuandClaude Opus 5.5 529b71f514 test: the rebuild test's floorFS cleanup stops the listener first, on every path
A failing path (start error, unexpected success, timeout) skipped the
mid-test stop, and the cleanups restore floorFS before the setup's Stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:42:52 -08:00
pingqiuandClaude Opus 5.5 241f7981b1 log.collect: any declared source not read whole makes redaction unproven
A declared log file refused before discovery (not a regular file, changed,
over 4 MiB, not text, unreadable), a process whose arguments could not be
read, and a failed or truncated unit command each make the bundle
manifest-only, not only a unit cut by the time budget. A missing file or a
gone process holds nothing to discover and stays only unavailable. In an
unproven bundle every artifact error is replaced by a fixed one, and the
skipped names are printed sanitized. A known credential used as a JSON
object key is redacted too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:40:32 -08:00
pingqiuandClaude Opus 5.5 e7e860c545 storage: the lost-CAS test pins the re-proposal to the set and base as first sent
The lost commit's change values and expected version are copied when it
is sent; the settlement's check and CAS must carry those values and that
base. Comparing the map with itself could not see an in-place change (a
mutant that edits the pending set before the re-proposal now fails).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:35:00 -08:00
pingqiuandClaude Opus 5.5 c56ba6f315 test: the rebuild test restores floorFS only after its listener stopped
The listener's connection goroutines still read floorFS while they settle
the session; restoring it before they stopped raced their read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:27:06 -08:00
pingqiuandClaude Opus 5.5 eefc728c41 docs: ledger row for the bundle's unproven-redaction rule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:23:40 -08:00
pingqiuandClaude Opus 5.5 e1225b1406 log.collect: no artifact is written whose redaction is not proven
Credential discovery read the declared log files only while the
collection's time budget lasted: a slow run (as under the race detector)
skipped the later files, and an earlier file was written with a
credential only a skipped one named. The declared log files are now read
whole for discovery whatever time is left (each is bounded at 4 MiB, at
most 32), after the declared commands and before the status reads. A
declared source the budget still cuts (a -unit's commands) makes the
bundle hold only its manifest, which says the redaction is not proven
and names the cut sources; the command reports it and exits 3. Each log
file is discovered once, not twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:22:45 -08:00
pingqiuandClaude Opus 5.5 67f52efa0d test: the backup fake's state is read and set under its lock (WIP: transport race next)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:15:53 -08:00
pingqiuandClaude Opus 5.5 80a9dcb898 storage: on v1.1 a cut commits by change; an unresolved one is re-proposed with the same changes
On the draft v1.1 format a cut's commit check and CAS go to the remote by
change (CheckCommitDelta, CASHeadDelta) with one owned change set built
from the chunks the cut changed; an unresolved commit keeps that set and
the settlement re-proposes it at the same base. Release builds keep the
full commit. The commit-site guard now also requires a by-change check
before a by-change commit, and the test remotes that hook CASHead route
CASHeadDelta through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:13:58 -08:00
Ping Qiu f647bfa955 Merge pull request #871 from seaweedfs/ci/keep-test-message-lines
ci: a failed test's message keeps its continuation lines
2026-12-01 03:26:38 -08:00
pingqiuandClaude Opus 5.5 d7abff2bac ci: a failed test's message keeps its continuation lines
The summary kept only each file:line line, so a message whose reason is on
its next lines (a holder's log tail after "its log ends:") lost it. Each
own message now keeps its last 20 continuation lines; a harness header's
dump stays out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 02:58:21 -08:00
Ping Qiu fd86f2301f Merge pull request #868 from seaweedfs/fix/verify-bindings-stat
fix: verify chunk bindings without reading their bodies
2026-12-01 02:26:04 -08:00
pingqiu 8f639975d3 Merge main into bindings verifier 2026-12-01 02:05:55 -08:00
pingqiu c967152e63 docs: qualify inline and replicated needle verification 2026-12-01 01:32:59 -08:00
Ping Qiu e09cdeb2f0 Merge pull request #867 from seaweedfs/fix/volume-directory-collision
fix: recover pending volume creates from id8 directory collisions
2026-12-01 01:27:09 -08:00
Ping Qiu 4f98d0ef38 Merge pull request #866 from seaweedfs/feat/v4b-pr3a
V4-B 3a: HEAD record version 1 with manifest sizes; on v1.1 a cut of a partial chunk fills it
2026-12-01 01:26:33 -08:00
pingqiu 95abcb3183 fix: verify backing needles with HEAD and retain exact chunk hashes 2026-12-01 00:42:47 -08:00
pingqiuandClaude Opus 5.5 c42dbc95a3 layout: a HEAD of a newer version is malformed to every caller, named as newer
ErrHeadNewerVersion now wraps ErrMalformed: every caller that refuses a
malformed HEAD for good refuses a newer one the same way (Start stays a
final refusal, never a retry loop), and its text says to use a newer
binary. The Start classification table pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:24:53 -08:00
pingqiu 697afeedf8 fix: validate owner identity before verify deduplication 2026-12-01 00:19:15 -08:00
pingqiuandClaude Opus 5.5 8bdbc05ba9 layout: omit an empty ext from Head's own JSON
Head's Go JSON (the status and CLI show output) wrote a nil Ext as null,
which reads back as the bytes null, and the ext check then refused the
HEAD as a v1.0 record carrying ext. Ext is now omitted when empty, so a
HEAD without ext reads back without one; a v1.1 HEAD keeps its ext.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:06:55 -08:00
pingqiu 950d636e93 fix: verify chunk bindings without reading their bodies 2026-12-01 00:03:07 -08:00
Ping Qiu 78994e9ba8 Merge pull request #865 from seaweedfs/test/rejoin-diagnostics
test: the rejoin failure reports both replicas' log tails
2026-11-30 23:57:36 -08:00
pingqiu da17629e75 docs: split collision invariants into single properties 2026-11-30 23:55:47 -08:00
pingqiuandClaude Opus 5.5 6eb191c38f storage: on v1.1 a cut of a partial chunk fills it; events take the store's bits
M1: on the v1.1 format the HEAD bytes a cut's COW copy fetches for a
partial chunk are also installed beneath its local writes, and the
absence is resolved as a fill (held until the store's batched mark), so
the cut's Hash meets U and the next cut finds the chunk local. Recover's
run-time Changed takes an absent chunk's coverage from the store's bits,
and the engine bitmap's landing no longer sends Write(all). Release
builds are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 23:32:54 -08:00
pingqiuandClaude Opus 5.5 b84f55ba3e chunkstore: keep an unchanged touched segment in the size; ext is a canonical object
A commit by change subtracts only the touched segments its new root no
longer names: a shard whose segment came out unchanged stays in the size.
HEAD's ext must be a JSON object in its canonical bytes, on encode and
decode, so it round-trips byte for byte. The format doc states the
upgrade order (version-aware readers before any v1.1 writer) and that the
fullest-HEAD figure is a sizing check.

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