Commit Graph
3606 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 deee2e25ff docs(invariants): INV-AUTH-REPLICATED-SPEC-NEEDS-LOOP-001 for the startup refusal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 04:03:48 -08:00
pingqiuandClaude Opus 5.5 bb97d6a7f4 fix(blockmaster): refuse a replicated cluster spec with the product loop off
With --cluster-spec, a replicated volume's placement is bound, its line
minted and its promotion gate run only by the lifecycle product loop. With
--lifecycle-product-loop-interval at its default 0 that loop never runs,
so the master starts, accepts heartbeats and never gives the volume a
line; every replica waits at epoch 0 with no error.

blockmaster now refuses to start when its cluster spec holds a volume with
replication factor above 1 and the loop is off, naming the flag. A static
--topology (whose observation controller mints) and single-replica volumes
are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 04:00:07 -08:00
Ping Qiu db064e0906 Merge pull request #637 from seaweedfs/fix/creation-phase-first
fix(master): creation is its own phase: no replacement decision before a volume's first line is healthy
2026-11-26 00:50:44 -08:00
Ping Qiu f538171940 Merge pull request #639 from seaweedfs/fix/delete-never-created
fix: a volume that never completed creation is deleted without its holder
2026-11-26 00:30:49 -08:00
pingqiuandClaude Opus 5.5 3f1d36f934 docs(invariants): the delete mark in the creation machine; its ledger row in Part B
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:14:50 -08:00
pingqiu 70ffb2e2f9 Merge the creation machine docs (#637) into the delete exit 2026-11-26 00:14:39 -08:00
pingqiuandClaude Opus 5.5 8d5d262b15 docs(invariants): the creation phase's machine in Part A, with its diagram
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:14:25 -08:00
pingqiuandClaude Opus 5.5 e7f238c4a8 fix(master): a store record rewrite keeps the delete mark; writer census
record() rebuilt a volume's store record from a new attestation and
carried Initial and AwaitingFirstReady over but not DeleteWithoutAck, so
a late attestation of the last store erased the mark and ended the frozen
wait. The mark is now carried like the other one-way fields and compared
in sameAttestation. TestTheDeleteMarkFreezesTheStoreWait (an attestation
of every store after the mark, then a restart) is the red control.

A source census pins the rules: a record is built only in open and in
record, record carries the mark over, and only markDeleteWithoutAck
writes it (true); its controls break each rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:14:14 -08:00
pingqiuandClaude Opus 5.5 6fa6f56089 fix(master): the delete without ack only in stage 1, and its mark freezes the wait
The delete without the holder's acknowledgement was admitted whenever the
end of creation was not recorded. That includes a volume that is serving
acknowledged writes whose end the master could not read (after a master
restart or a partition): the reservation stopped its grants, the proof
then found a write and refused, and the volume could neither serve, fail
over nor be deleted.

It is now admitted only in stage 1, while the master's record still
awaits a replica store (the primary serves nothing until every store is
recorded). The mark is written durably first, in the lock that ends the
wait, and freezes the record in stage 1: stores attested after it never
end the wait, so the primary never starts serving. Past stage 1 the
live-lease refusal stays; a broken creating primary's lease ends by
itself and the ordinary delete then applies. The survivor proof at the
HEAD update is no longer needed and is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:10:17 -08:00
pingqiu 98c033d77c Merge the reopen fixture (#637) into the delete exit 2026-11-26 00:06:16 -08:00
pingqiuandClaude Opus 5.5 d9a2783577 test(nvmerdma): the reopen test's primary attests its stores through the heartbeat RPC
The test's volume host has no replication slot, so it never attests
stores and the volume stayed in its creation phase. The fixture now sends
r1's heartbeat with its store attestation through the master's own
ReportHeartbeat RPC, as a replicated primary does after its peers'
barriers: no test hook, no hand-written record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:06:13 -08:00
pingqiuandClaude Opus 5.5 d6aa32ce58 fix(master): a delete without the holder's ack finishes only on proof the volume is empty
The never-created delete was admitted for any creation-hold reason,
including a volume whose primary had acknowledged writes before the
master recorded anything. Now:

- it is admitted only while creation has not ended, and the master's
  record is marked durably first, in the lock that ends creation, so
  creation never ends after the admission (the delete reads the record as
  it was admitted, also after a restart);
- deleting HEAD waits out the holder's lease horizon as before, and then
  requires proof that the volume is empty, read after the horizon: stage 1
  (not every store attested: the primary served nothing), or N-K+1
  survivors that answered on valid tables at end 0. A survivor holding a
  write, a silent survivor or an unknown ack profile refuses;
- a volume whose creation ended keeps the live-lease refusal.

Part A (M2) and the ledger row INV-WS-DELETE-WITHOUT-ACK-001 name the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:03:35 -08:00
pingqiu 6ab7a1218a Merge the creation predicate (#637) into the delete exit 2026-11-26 00:02:32 -08:00
pingqiuandClaude Opus 5.5 e8c55183c9 test(blockvolume): a volume that served before its first gate tick fails over
Through the production binaries: an RF3 sync-quorum primary serves and
acknowledges a write after its stores are attested and is killed before
the next product tick (30 s loop); the survivors' write ends creation, the
gate fails the volume over and the write reads back on the new primary.
The test checks that the window really occurred.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:01:51 -08:00
pingqiuandClaude Opus 5.5 12c1e55e63 fix(master): creation ends at the first ready answer or a survivor's write
A volume's creation phase ended only at the primary's first ready answer,
read by a gate tick. A primary that served right after its stores were
attested and died before the next tick left a volume that had acknowledged
writes held as creating for good: no gate, no operator failover.

Creation now ends, durably and for good, at the first of:
- the line's primary answering ready, or
- a survivor answering DurableLSN > 0 at the current line (its epoch-table
  row at the current epoch, or none): under the quorum ack every
  acknowledged write is on a survivor.

A failed write of the end of the store wait keeps the volume held (it is
reported as one store awaited) instead of releasing it with no record of
its next stage.

Tests: the gap through the operator's failover, the first-of rule and its
one-way record across a restart, the failed stage write under both gates,
the operator's move and a restart, and the primary's awaiting answer alone
holding an established volume on both gates and the fenced operator path
(each red with its guard removed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:01:51 -08:00
Ping Qiu 11a1af3e05 Merge pull request #641 from seaweedfs/docs/current-restore
docs: restore as v1 ships it; fork removed
2026-11-25 23:54:38 -08:00
pingqiuandClaude Opus 5.5 1c7d619ded docs: an older blockmaster copy can reuse epochs; no promised refusal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:46:15 -08:00
pingqiuandClaude Opus 5.5 004fd30d35 docs: restored-volume snapshots, release, and three operator rules
A restored volume takes no scheduled snapshot until its device has been
read once; a manual one names the source's chunks and cannot be
restored. ops chunk release is a repair step. The lifecycle rules name
one blockmaster per cluster, no restore of its directory from an older
copy, and that a deleted volume's name cannot be created again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:43:57 -08:00
pingqiuandClaude Opus 5.5 3bc43a6879 docs: restore as v1 ships it; fork removed
Restore is created with --master and fills on access (no restore driver,
no background copy); its source snapshot stays a dependent for the
target's life. Fork and template retirement are not in this release.
The documented show, snapshots and snapshot-delete commands get the
required --master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:36:53 -08:00
pingqiu 1a6c4b13e4 Merge the creation phase (#637, with main) into the delete exit 2026-11-25 22:13:07 -08:00
pingqiu 28f0964b61 Merge main (with #629) into the creation phase 2026-11-25 22:13:07 -08:00
Ping Qiu c83b5ffc62 Merge pull request #629 from seaweedfs/feat/standalone-failover-cli
feat(sw-block): ops failover for standalone; the alpha stack deploys the manual failover
2026-11-25 22:12:26 -08:00
pingqiuandClaude Opus 5.5 cbd0f12d0c test(master): the endpoint fixture is an established volume
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:07:41 -08:00
pingqiu c84cb4216e Merge #629 (standalone failover) into the creation phase
# Conflicts:
#	core/host/master/failback_runtime_test.go
#	core/host/master/planned_move.go
2026-11-25 22:02:11 -08:00
pingqiu 1822110220 Merge main into feat/standalone-failover-cli
# Conflicts:
#	cmd/sw-block/main.go
#	core/authority/directive.go
2026-11-25 21:52:39 -08:00
pingqiuandClaude Opus 5.5 2e2a425eca fix(master): the delete reads the creation phase with the volume's line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:47:00 -08:00
pingqiuandClaude Opus 5.5 3615b1d7e8 test(master): the never-created delete finishes past the lease horizon
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:46:59 -08:00
pingqiuandClaude Opus 5.5 f5641b362f test: the reservation guard lives in reserveWorkspaceDeletion; the live-lease delete fixture is an established volume
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:46:59 -08:00
pingqiuandClaude Opus 5.5 353163e23c fix: a volume that never completed creation is deleted without its holder
The layout delete's reservation was refused while any lease was live, and
a creating primary that is stuck (a replica store never attested) keeps
renewing, so the only exit from the creation phase, delete and recreate,
was closed. A volume whose master record never left the creation phase
(it served nothing, acknowledged nothing) is now reserved for delete under
a live lease: the reservation stops every grant at once, the delete's HEAD
update still waits until no lease is live, and HEAD deleting then admits
no claim or commit. A volume that ever completed creation keeps the
live-lease refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:46:59 -08:00
pingqiuandClaude Opus 5.5 8d2c0dafd5 test(master): a never-created volume is deleted without its holder; an established one is not (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:46:59 -08:00
pingqiuandClaude Opus 5.5 8c0a4f7123 docs: creation ends at the primary's first ready answer (INV-PROMOTE-CREATION-WAIT-001)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:45:41 -08:00
pingqiuandClaude Opus 5.5 b201bbb74d test(master): fixtures record the first ready answer where the primary served; the restart gap is still creating
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:40:26 -08:00
pingqiuandClaude Opus 5.5 5e520aa762 test(master): the boot-grace fixture is an established volume (first ready answer recorded)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:34:44 -08:00
Ping Qiu 5d58337c3f Merge pull request #638 from seaweedfs/fix/pool-read-verify
storage: typed error for a pool chunk off its HEAD ref; read-verify controls
2026-11-25 21:32:26 -08:00
pingqiuandClaude Opus 5.5 2eb5fbfcab fix(master): creation ends at the primary's first ready answer at its first line
Not at the last store attestation: a primary restarted after the last
attestation, before it adopts the complete assignment, was no longer
creating by the record and could be replaced. The record now sets
awaiting_first_ready in the same write that clears its initial set, and
clears it, durably and for good, at the line's primary's first ready
answer; until then the volume is creating. A record written before the
field existed carries none, so an established volume is never reopened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:28:41 -08:00
Ping Qiu 506c8f9b24 Merge pull request #636 from seaweedfs/fix/restarted-primary-new-endpoint-version
authority: a restarted primary is re-issued its line at a new endpoint version
2026-11-25 21:20:11 -08:00
pingqiuandClaude Opus 5.5 30c2f43579 tests: gofmt the cut test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:16:49 -08:00
pingqiuandClaude Opus 5.5 49f8c1630d tests: read-verify controls compare extent bytes; cut test tracks the child to exit
Review amendments (no product change):
- storage: both refusal controls read the chunk's blocks from the extent
  file before the refused fill and after it, and require them unchanged;
  a fill that installs damaged bytes and then refuses is now red (it left
  absent and localBlocks untouched, so the old assertions passed).
- chunkstore cut test: the child's stdout is read to EOF, so an upload
  begun during the delay or the kill is counted; CUT-ERR at any point
  fails the round; the child must have died by SIGKILL; objects 0..last
  (at least the first four) are validated every round (an object never
  begun must be absent) and all of them are completed by a new session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:16:32 -08:00
pingqiuandClaude Opus 5.5 cb3f8a1da7 test: the overlap control's target report is fresh
The master test's freshness window is one second; a target report one
second old had already expired, so no report was found at its endpoints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:03:42 -08:00
pingqiuandClaude Opus 5.5 74ac7294fc blockvolume: pin that the command adopts only lines naming its process
A guard on hostConfig's LinesNameTheirProcess, the refusal control also
checks nothing is recorded, and the M3 diagram and table state the
adoption guard (the row maps to M2 refresh and M3 adoption).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:48:06 -08:00
pingqiuandClaude Opus 5.5 8ddb61001e storage: typed error for a pool chunk off its HEAD ref; read-verify controls
Every read of a pool object already verifies its bytes against the name
twice: the layout reader (ErrCorrupt -> ErrRemoteDamaged) and the
engine's fill (sha256 and size against the HEAD ref). The engine's
refusal was an untyped string; it is now ErrChunkContentMismatch, on the
read-miss fill and on the cut COW fill alike.

Controls:
- storage: a seeded chunk whose bytes are flipped, truncated or extended
  is refused with ErrChunkContentMismatch on a guest read miss and on
  HydrateAll; nothing is served or installed, and once the remote serves
  the named bytes the same reads return HEAD's data.
- durable, end to end over the real layout remote: a chunk captured to
  the pool, its blob damaged under the filer entry, a fresh replica
  attached from HEAD: the guest read fails with a typed error and never
  returns the stored bytes; restored, it reads HEAD's data.
- chunkstore (real filer, chunkstore_integration): a child uploading
  pool objects through EnsureObject is SIGKILLed at random points over
  many rounds; each object it began is absent or holds exactly the bytes
  its name hashes, and a new session completes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:42:03 -08:00
pingqiuandClaude Opus 5.5 9b1c5c89a1 refactor(master): one inCreationPhase decision every replacement entry calls first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:39:38 -08:00
pingqiuandClaude Opus 5.5 a6f7eca84b authority: a line is issued for the process at its endpoints
The incarnation source looks up the slot at the ask's endpoints, never
the same replica reported by another host. A production volume adopts
no line that names no process; the target's first report re-issues it
once for that process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:38:58 -08:00
pingqiuandClaude Opus 5.5 5364850447 test(master): drop the delete-of-a-stuck-creating-volume test pending a ruling (the delete is refused today)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:31:15 -08:00
pingqiuandClaude Opus 5.5 aa66ad56a2 test(master): creation phase: operator entry, master restart, delete of a stuck volume
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:30:41 -08:00
pingqiuandClaude Opus 5.5 3a36ddcf5b docs: INV-PROMOTE-CREATION-WAIT-001 is the creation phase, decided on the master's record
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:29:31 -08:00
pingqiuandClaude Opus 5.5 3d6b0031ac test(master): creation-wait tests follow the creation phase; remaining fixtures record their stores
A creating volume is no longer replaced when its primary is not ready for
another reason, answers a stale epoch, or has an unacceptable slot: no
promotion decision is even probed (the owner's ruling and its model).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:23:38 -08:00
pingqiuandClaude Opus 5.5 7642b2c8e0 authority: the workspace writer and ask dedupe keep the line's process
The workspace record writer copies the line's incarnation, so a lease or
journal write no longer erases it before a reload; a queued refresh for
one process is replaced when another reports at the same address; the
RefreshEndpoint transition names the restart case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:21:02 -08:00
pingqiuandClaude Opus 5.5 291bc47b53 test(master): fixtures of established volumes record their replica stores
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:17:06 -08:00
pingqiuandClaude Opus 5.5 7863d9e1f1 authority: asks built outside the controller record the target's process
A heal, a planned or workspace move or an operator's request names no
incarnation; the publisher records the one the target reports now, so
the promoted process's first report re-issues nothing. The volume's
refusal of a line issued for another process now comes before anything
of it is recorded.

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