Commit Graph
3468 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 77d238ce59 volume delete: RED controls for the r2 review
Review of dfc8f19 (codex01, V:/share/rdma/codex01-block152-r2-review-
20261116T0342Z/REVIEW.md). Controls failing against stubs restoring the
reviewed behaviour:

- P1: an unknown id's admission and a known record's ordinary
  DeleteVolume leave CreateVolume free, also after a restart
  (TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart).
- P2 persistence: the mark is intent-only (no write/sync); write,
  rename and directory-sync faults and a restart lose it
  (TestDeletionReservations_*).
- P2 rollback: a give-back (claim, held HEAD) leaves the master
  exclusion in place; a lost admission response reads as a refusal
  (TestCatalog_DeleteVolumeGivesBackOnALiveClaim, ...HeldAfterAdmission
  GivesBack, ...LostAdmissionResponse, TestOpsChunk_VolumeDelete with a
  real master: claim refusal must leave the id usable).
- P2 failed abort: B's failed tombstone write still frees the name, so
  A's late publication survives a completed delete
  (TestCatalog_FailedAbortCannotHideALatePublication).
- P2 concurrent deletes: D1's revert after D2 committed counts as a
  give-back (TestCatalog_ConcurrentDeleteCannotRollBackACommittedOne).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:54:32 -08:00
pingqiuandClaude Opus 5.5 dfc8f19ef1 volume delete: master admission, one HEAD linearization point
(a) Admission at the master: LifecycleService.MarkVolumeDeleting holds
    workspaceMu (every assignment, placement and binding write) and marks
    VolumeRecord.Deleting inside RecordWorkspaceDeletion's check (refused
    with live authority without a clean revocation ACK, a pending move or
    a queued placement). Afterwards publication admission, the placement
    reconciler, the workload planner, binding/placement/move RPCs and
    CreateVolume refuse the volume.
(b) One HEAD write from the HEAD read (active or detached, not held) to
    state deleting, chunks kept. Every read decides "held" afresh.
    ChunkRemote.CASHead refuses to move a deleting or deleted HEAD
    (ErrChunkHeadPrecondition + ErrChunkHeadDeleted), so no attach,
    claim or restore revives it; EnsureVolume refuses it; Fork and
    CreateSnapshot check the volume again after taking their claim/name
    and back out.
(c) Claims read after (b): a live claim reverts HEAD (detached or
    active, as before) and refuses with snapshot_claimed.
(d) Then every snapshot name, published or not (an unpublished attempt
    gets an aborted tombstone), goes through markDeleting and is freed;
    the fork claim is released and reported only when confirmed.
(e) HEAD becomes deleted (no chunks), VOLUME is marked deleted.

A failed delete reports what it did (admitted, headMarked, reverted,
snapshots, aborted attempts, claimReleased, completed, uncertain); the
CLI prints that with the error and exits nonzero. The CLI's admission
is MarkVolumeDeleting (QueryVolumeStatus is no longer used).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:31:09 -08:00
pingqiuandClaude Opus 5.5 5b82b324d6 volume delete: RED controls for one linearization point
Review of 626c7de (codex01). One control per schedule, each failing
against a stub that restores the reviewed behaviour:

- P1 1: a holder that attaches before the HEAD mark's first read is
  deleted (TestCatalog_DeleteVolumeRefusesAnAttachBeforeTheMark).
- P1 2: an attach that passed EnsureVolume revives a deleting/deleted
  HEAD through CASHead (TestCatalog_DeletedHeadCannotBeRevivedByAClaim).
- P1 3: after the master's delete mark, an existing placement still
  leads to an assignment, the reconciler places, the id can be created
  and bound again (TestMarkVolumeDeleting_StopsLaterAssignment...).
- P2: a fork claim after the check is refused only after irreversible
  writes (TestCatalog_DeleteVolumeGivesBackOnALiveClaim); a fork after
  the mark installs (TestCatalog_ForkAfterTheDeleteMarkRefuses); a held
  snapshot publication and a snapshot started after the mark escape the
  delete (TestCatalog_DeleteVolumeCatchesInFlightSnapshots); a failed
  claim removal is reported released, and the CLI drops partial effects
  (TestCatalog_DeleteVolumeTombstonesAndReleases, TestOpsChunk_VolumeDelete).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:31:08 -08:00
pingqiu bb52a686b8 fix: decode HEAD with a strict format-specific schema 2026-11-15 19:11:42 -08:00
pingqiu e2c69c9686 test: reject Unicode folded fields and corrupted-discriminator GC bypass 2026-11-15 19:10:57 -08:00
pingqiu 1dace522c2 fix: reject every case-insensitive mixed representation field 2026-11-15 18:59:40 -08:00
pingqiu 6c740a1466 test: reject case-folded mixed manifest field aliases 2026-11-15 18:59:22 -08:00
pingqiu 0ff7a4b4b7 fix: account immutable manifest objects at their exact stored size 2026-11-15 18:56:58 -08:00
pingqiu ae907d6ea6 fix: reject mixed manifests and share segmented roots with master and usage 2026-11-15 18:56:14 -08:00
pingqiu 701a304257 test: refuse mixed roots and cover segmented accounting and clean moves 2026-11-15 18:55:13 -08:00
pingqiuandClaude Opus 5.5 626c7de1a2 chunkstore: volume delete
- Catalog.DeleteVolume refuses a volume in use (an active HEAD with a
  holder, or the caller's InUseCheck: the CLI asks the blockmaster
  whether it is assigned or served) with volume_in_use, and a volume
  whose snapshot a live fork claims with snapshot_claimed, before any
  write.
- Then: HEAD becomes a tombstone (state deleted, no chunks) by a
  conditional write on the HEAD read, so an attach in between wins;
  VOLUME is marked deleted; every snapshot goes through markDeleting
  (the one mark path) and its name is freed; a fork's claim on its
  parent is released. GC reclaims (the tombstone holds no roots; the
  snapshots drop out after grace). A rerun finishes a partial delete.
- A deleted id is never reused: EnsureVolume (attach, create) refuses a
  deleted VOLUME or HEAD with volume_deleted, and so does Fork for a
  deleted target or source (the source checked after the claim).
- storage: HEAD state "deleted"; the HEAD decoder accepts it only with
  no chunks, holder or detachedBy.
- CLI: sw-block ops chunk volume-delete <vol> --chunk-filer --master;
  gc and volume-delete share masterEvidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:49:18 -08:00
pingqiuandClaude Opus 5.5 a73001b121 chunkstore: RED controls for volume delete
claude05's item (2026-11-16 02:39Z): `sw-block ops chunk volume-delete`
plus Catalog.DeleteVolume. Controls, failing against a DeleteVolume
stub that deletes nothing:

- an attached volume (HEAD held) and one the blockmaster reports in use
  are refused with volume_in_use, nothing written;
- a volume whose snapshot a live fork claims is refused with
  snapshot_claimed, nothing written;
- fork w2 from s1, delete w2: HEAD tombstone (deleted, no chunks),
  VOLUME deleted, snapshots freed; DeleteSnapshot s1 then succeeds; the
  id is never attached, recreated or forked to again; an incomplete
  fork's claim is released; a rerun replays;
- an attach between the check and the tombstone wins (held caller);
- the CLI needs a volume and --master and refuses an attached volume;
- real service + real GC: exactly the chunks only w2 and S1 reach are
  reclaimed, w1's HEAD and S2 stay readable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:49:17 -08:00
pingqiu ddae3ac15e test: pin failure joins range reuse and document manifest compatibility 2026-11-15 18:39:35 -08:00
pingqiu 24cad21474 fix: retain manifest capability and exact root identity through provider cuts 2026-11-15 18:37:33 -08:00
pingqiu 806da162bb test: preserve manifest preparation through the production provider 2026-11-15 18:36:50 -08:00
pingqiu 4479bd4361 test: trace immutable segments through real blockmaster and filer GC 2026-11-15 18:35:12 -08:00
pingqiu b715c8f7b8 Merge reviewed GC fixture prerequisite from PR 148 2026-11-15 18:35:12 -08:00
pingqiu e469c5f575 test: measure fsynced 64-chunk cuts and written 10GiB root copies 2026-11-15 18:33:52 -08:00
pingqiu 6cf3f9d1b9 test: pin upload caps cancellation and flat no-op upgrade lineage 2026-11-15 18:30:53 -08:00
pingqiu d2b9c5db37 test: cover immutable segment reuse crash cuts and fail-closed GC 2026-11-15 18:29:46 -08:00
pingqiu ce6e4449d8 feat: expose upload concurrency and retain manifest-aware contract checks 2026-11-15 18:27:57 -08:00
pingqiu 631e30537b feat: preserve root-only forks and trace segment children during GC 2026-11-15 18:26:44 -08:00
pingqiu 11b7aa94d8 test: retain segmented fork data after deleting the parent snapshot 2026-11-15 18:25:58 -08:00
pingqiu 9dfef3b4fd feat: build immutable range manifests before the fenced root CAS 2026-11-15 18:25:01 -08:00
pingqiu c1a917b6bf test: require a real capture to publish a segmented root 2026-11-15 18:23:31 -08:00
pingqiu 76c8de6b10 feat: bound parallel capture and pre-copy uploads 2026-11-15 18:22:35 -08:00
pingqiu 517062f058 test: require capture uploads to overlap under an intent 2026-11-15 18:21:47 -08:00
pingqiu f634b0db04 Settle block metadata before persisting seeded chunk frontier 2026-11-15 17:52:26 -08:00
pingqiu 463f984b16 Reproduce missing metadata barrier in seeded chunk frontier 2026-11-15 17:52:05 -08:00
pingqiu 27614bdbde Measure default v1 nil-hook read write allocations and hot-path cost 2026-11-15 17:34:31 -08:00
pingqiu 7aef3877da Invoke neutral metadata write verify and pre-checkpoint durability hooks 2026-11-15 17:33:22 -08:00
pingqiu 7583fbcb18 Add neutral metadata factory admission and recording-hook RED controls 2026-11-15 17:32:43 -08:00
pingqiu f9da1a371d fix: register desired volumes from complete cluster specifications 2026-11-15 17:21:12 -08:00
pingqiu e5578df747 test: register the GC fixture volume before authority publication 2026-11-15 17:04:16 -08:00
pingqiuandClaude Opus 5.5 90c4fc6cb3 transport: make the C2 dense-LSN edge test deterministic
TestC2_NoGapDenseLSNEdge asserted that a Realtime NotifyAppend at the
dense edge (cursor=10, head=11, lsn=11) emits EmitKindLive, while the
shipper's 2 ms timer drain was running. When a tick landed between
primary.Write and NotifyAppend, the timer shipped lsn 11 from substrate
first (EmitKindBacklog, debt-first per §6.3) and NotifyAppend took the
idempotent skip, so the test saw kind=1. That is correct product
behavior: the entry ships exactly once at the right LSN, and the kind
tag is observability only (WALKindBacklog vs WALKindSessionLive
counters; the LiveTail probe is marker-only).

- TestC2_NoGapDenseLSNEdge now disables the timer drain and drains the
  initial backlog with DrainBacklog, so the Live assertion no longer
  depends on scheduling.
- New TestC2_DenseLSNEdge_TimerWinsRace_ShipsOnce pins the other order
  deterministically: the timer ships the new entry before NotifyAppend
  arrives; NotifyAppend returns nil and does not emit again.

No product change, no timeout changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:58:10 -08:00
Ping Qiu 9c29ee9c42 Merge pull request #142 from seaweedfs/feat/chunk-retention
chunkstore: snapshot retention and space accounting (part 1)
2026-11-15 16:47:14 -08:00
pingqiuandClaude Opus 5.5 a219a8a75d Merge origin/main (9735219) into feat/chunk-retention
Conflict in cmd/sw-block/chunk.go resolved as the union: the usage
string lists cut|snapshot|snapshots|snapshot-delete|fork|detach|show|
gc|usage|retain, and the switch keeps #140's "gc" case with "usage"
and "retain".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:44:51 -08:00
Ping Qiu 9735219581 Merge pull request #144 from seaweedfs/fix/pillar3-samelba-deterministic-claude04
test: make Pillar3 SameLBAArbitration deterministic with a pre-barrier hold
2026-11-15 16:43:05 -08:00
Ping Qiu 25e0dbdb5b Merge pull request #141 from seaweedfs/feat/workspace-volume-bindings
feat: prepare per-volume workspace endpoints and chosen-node placement
2026-11-15 16:42:56 -08:00
Ping Qiu 569def89e1 Merge pull request #140 from seaweedfs/feat/chunk-gc-cli
Expose chunk GC preview and explicit apply with blockmaster authority
2026-11-15 16:42:47 -08:00
Ping Qiu 4e5da657f5 Merge pull request #136 from seaweedfs/blockc/ublk-frontend-m5
ublk frontend: serve a volume as /dev/ublkbN (io_uring command queues)
2026-11-15 16:42:37 -08:00
Ping Qiu 48fae0300d Merge pull request #139 from seaweedfs/feat/typed-recovery-reasons
volume: report wal_corrupt / io_error from a failed durable recovery at once
2026-11-15 16:42:27 -08:00
pingqiuandClaude Opus 5.5 78f56c31d8 test: release the stale-BASE hold with a defer, before executor shutdown
Review follow-up: the release was a t.Cleanup registered before Start, and
cleanups run LIFO, so the executor shutdown Start registers ran first; a
t.Fatal while the base frame was held would deadlock StopAndWait. A defer
inside the scenario runs before every t.Cleanup, including on t.Fatal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:07:23 -08:00
pingqiuandClaude Opus 5.5 1b764f1b3b chunkstore: claim cleanup conditioned on the state it read
dropForkClaim's write is conditioned on {state, claims} as read; a lost
condition re-reads a fresh copy, so delete metadata is never
overwritten. (With the shared mark path a delete also clears the dead
claim first, which changes the condition on its own.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:03:35 -08:00
pingqiuandClaude Opus 5.5 cbe6e8e150 chunkstore: RED control: claim cleanup never undoes a delete
Review of 02d0631 (P2): dropForkClaim conditioned its write on the
claims only, so a completed fork's cleanup that read the parent, paused
while an explicit delete marked it, then wrote back its stale copy,
resurrecting an unnamed active snapshot. TestCatalog_ClaimCleanupNever
UndoesADelete fails against the old cleanup condition and the old
(claim-blind) delete mark, restored as stubs: state "active",
deleted_ns gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:03:35 -08:00
pingqiuandClaude Opus 5.5 e7fc9a5254 chunkstore: one mark path for retention and explicit delete
markDeleting is the only way an attempt is marked deleting: conditioned
on {state active, gen, no claims}, dead claims cleared first, a lost
condition decided again. Retain keeps a claimed snapshot (fork_held);
DeleteSnapshot refuses it with snapshot_claimed naming the fork
(claude05's ruling, 23:58Z).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:01:55 -08:00
pingqiuandClaude Opus 5.5 6db62358fe chunkstore: RED control: delete refuses a fork-claimed parent
claude05's ruling (2026-11-15 23:58Z): an explicit DeleteSnapshot of
a snapshot an incomplete fork claims is refused with snapshot_claimed
(409, not retryable, naming the fork volume); a completed or aborted
fork no longer blocks. Controls, failing against the old mark (blind to
claims) restored as a stub: TestCatalog_DeleteRefusesAClaimedParent, the
409 mapping, the real-filer refusal in TestIntegration_RetainHeldSchedules,
and TestFork_IncompleteRetryBoundToOriginalImage, which now expects the
refusal and drops the claim (as a pre-claim fork) to keep testing the
image binding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:01:54 -08:00
pingqiuandClaude Opus 5.5 02fb0914b4 test: Pillar3 SameLBAArbitration holds a stale BASE frame instead of a pre-barrier hook
Review follow-up. The pre-barrier hold proved in-session delivery and
convergence but no longer the test's point: a newer WAL write for an LBA must
win over an OLDER base frame for that LBA that arrives later.

Drop the production SetPreBarrierHook seam (core/recovery is back to main)
and hold the base lane instead, through the existing WithPrimaryStorageWrap:
staleBaseHold captures the base read of LBA 5 (old value A) and holds it; the
test pushes the same-LBA overwrites (the session cannot seal its recovery cut
while base is held, so they ship in-session: this is also what fixes the
flake), waits until the replica holds B at LBA 5, then releases the stale A
frame. Convergence requires LBA 5 == B: RebuildSession.ApplyBaseBlock must
skip a base frame for an LBA the WAL lane already applied (bitmap).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:57:37 -08:00
pingqiuandClaude Opus 5.5 02d06311f9 chunkstore: fork claims on the parent snapshot entry
Replaces the separate hold objects with one conditional write on the
parent attempt's own entry (codex01's design):

- Fork adds its claim (target/request) to the entry before using it,
  conditioned on {state active, claims as read}; a deleting parent is
  refused. It removes its claim once its HEAD exists (or a sweep's
  tombstone settles the target).
- Retain marks deleting only conditioned on {state active, gen, no
  claims}; a lost condition re-reads and decides again. Claims that
  can never matter (target has a HEAD, or its VOLUME is another
  request's) are cleared conditionally first; any other claim keeps the
  snapshot, with no lifetime. No listing, so no paging.
- A dry run lists attempts a stopped pass left deleting, as apply
  frees them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:53:04 -08:00
pingqiuandClaude Opus 5.5 6a41bc40bb chunkstore: RED controls for fork claims on the parent entry
Controls for the four fork schedules of the second review, failing
against stubs where Fork writes no claim, the delete mark is not
conditioned on claims, and a dry run omits unfinished deleting
attempts:

- a fork claiming between retention's check and its mark (unit and
  real filer);
- a fork that died before its VOLUME keeps the parent 30 days later;
- a refused same-target request leaves the first request's claim;
- a dry run lists the attempt a lost response left deleting.

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