Commit Graph
21909 Commits
Author SHA1 Message Date
pingqiu 40952ad00d test: bind holder crash recovery to its issued operation handle 2026-12-01 18:49:11 -08:00
pingqiu e08a6fb1db fix: end snapshot operation namespace with volume deletion 2026-12-01 18:49:11 -08:00
pingqiu 55731e6cdf fix: persist initial snapshot delete absence as refusal 2026-12-01 18:48:51 -08:00
pingqiu 9c6f0c2acb feat: bind snapshot delete admission to its durable target 2026-12-01 18:48:51 -08:00
pingqiu c59d959a18 fix: preserve issued snapshot operation incarnations 2026-12-01 18:48:51 -08:00
pingqiu 30a83df32a test: allow admission contention under race instrumentation 2026-12-01 18:48:51 -08:00
pingqiu e70a7f9a6f feat: bound snapshot receipts with an index-first retirement protocol 2026-12-01 18:48:51 -08:00
pingqiu 5f0c5513a9 test: preserve snapshot intent across torn admission 2026-12-01 18:48:40 -08:00
pingqiu cee64dbaa8 test: expose concurrent snapshot operation capacity overflow 2026-12-01 18:48:40 -08:00
pingqiu a375d7bf5e test: expose unbounded durable snapshot operation admission 2026-12-01 18:48:40 -08:00
pingqiu 77e14a9428 fix: deduplicate synchronous retries of active snapshot operations 2026-12-01 18:48:40 -08:00
pingqiu e53cb39cbe test: pin single-binding refinement across split snapshot publication 2026-12-01 18:48:40 -08:00
pingqiu dce2813b33 docs: clarify bounded snapshot receipt retention contract 2026-12-01 18:48:40 -08:00
pingqiu c60d9421eb test: expose stale snapshot publication after owner readmission 2026-12-01 18:48:40 -08:00
pingqiu 6add466034 fix: preserve snapshot outcomes after uncertain provider failures 2026-12-01 18:48:40 -08:00
pingqiu 5b25575a55 feat: own snapshot creation with a bounded process executor 2026-12-01 18:48:39 -08:00
Chris LuandClaude Opus 5.5 d915787cf1 mq: a topic can name an Iceberg table in a table bucket (#13246)
* mq: add a table option to topic configuration

ConfigureTopicRequest, ConfigureTopicResponse and
GetTopicConfigurationResponse carry a TopicTable: the table bucket ARN,
namespace and name of the Iceberg table that holds the topic's compacted
history. A request without it keeps whatever the topic has; one with an
empty table bucket ARN asks to detach it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq: map a topic's record type to an Iceberg table layout

The topictable package lays out the table a topic's compacted history
goes into. Its columns are _partition, _offset, _ts_ns, _ts (a
timestamptz copy of _ts_ns to partition on) and _key, then the record's
fields, or _value for a schemaless topic. Scalars map to their Iceberg
counterparts, TIMESTAMP to timestamptz, records to structs and repeated
fields or list types to lists, with required-ness taken from the field.
A DECIMAL field has no precision or scale of its own, so it takes the
decimal(38, 18) the topic's parquet files already use.

The spec is identity(_partition) and day(_ts), the sort order _partition
then _offset, and the seaweedfs.mq.topic property names the owning topic.
CheckSchema says whether an existing table can hold a topic's rows,
matching columns by name so the ids a table assigns do not matter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* iceberg: create and load a table in process

The create handler splits into planCreateTable, which checks the name,
authorizes the create and builds the first metadata, and
registerCreateTable, which stages the metadata file and registers the
table, with stage-create still handled between them in the handler.
Server.CreateTable runs both for a caller inside the cluster, and
Server.LoadTable answers what a load does, sharing the GetTable call and
the metadata parse with the handler. A server-side component that needs
its own table now gets the same location, metadata file, exclusive
staging and cleanup as a REST client, rather than writing metadata by
hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: keep a topic's table in topic.conf

ConfigureTopic stores the requested table with the rest of the topic's
configuration, so it survives restarts and moves to another balancer. A
request that does not name a table keeps the stored one, including one
that changes the partition count, and an empty table bucket ARN detaches
it. GetTopicConfiguration returns it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: create or adopt a topic's table on ConfigureTopic

When a configure names a table, or changes the schema of a topic that
has one, the balancer loads the table through the Iceberg catalog the
broker now keeps over its filers. A missing table is created through the
catalog's own create path with the topic's layout and the
seaweedfs.mq.topic property; the table bucket and namespace must already
exist. An existing table is accepted only if that property names this
topic, its location is inside its table bucket, and its columns can hold
the topic's rows, so a topic never takes over a table it did not create
and a schema change the table cannot follow is refused.

The broker creates the table with no caller identity, as trusted
cluster tooling, so the table is owned by its namespace's owner like any
other table there. Deleting a topic only removes /topics and leaves the
table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: refuse to leave a topic table that holds data

A configure that detaches a topic from its table, or points it at
another one, first loads the current table, and is refused while that
table has any snapshot: its history would be left with no topic to read
or trim it. A table that is still empty, or that its owner has dropped,
can be left, and stays where it is with its property. Detaching a table
that holds data is left to an explicit command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: pass the table catalog's answers through the filer accessor

The filer accessor treats any error as a failed filer: it records the
failure, asks the next filer and wraps the last error with %v. A catalog
answer such as NoSuchTable then reached ConfigureTopic as an opaque
string, so a missing table was reported instead of created. The catalog
now goes through an adapter that returns the catalog's own answers
unwrapped and leaves failover to real filer failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: a table hidden by its policy still holds the topic's history

GetTable answers NoSuchTable both for a table that is gone and for one a
policy denies the caller, so a topic whose table carried snapshots under
a policy denying GetTable could detach as if the table had been
dropped. When the catalog says the table is missing, the broker now
looks for its record in the filer with the new s3tables.TableRegistered,
which finds what GetTable finds before policy, and refuses to leave a
table that is registered but unreadable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: fail over the table catalog's internal errors

The adapter between the table catalog and the filer accessor passed
every S3TablesError back as a successful filer call. An InternalError is
what the catalog answers when its own read of the filer fails, so a
broken filer was recorded healthy and no other filer was asked. Only
the catalog's refusals pass through now; an internal error goes back to
the accessor, which marks the filer failed and tries the next one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq: name a table's owning topic by its path under /topics

The seaweedfs.mq.topic property was <namespace>.<topic>, and topic names
may hold dots, so a.b/c and a/b.c wrote the same value and either could
adopt the other's table. The value is now <namespace>/<topic>, the
topic's directory under /topics: two topics that write the same value
already share one topic.conf, so they are the same topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq: reserve the day partition field's name in a topic's table layout

The spec partitions by day(_ts) under the name _ts_day, and Iceberg only
lets a partition field share a column's name when it is that column's
identity. A topic with its own _ts_day field mapped fine and then failed
the table create with an invalid partition spec. Schema now refuses the
name up front, with the system columns, saying it is reserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: let the table catalog fail over to every discovered filer

The broker's filer accessor lists only the current filer, so the
failover the catalog adapter relies on had nowhere to go: an internal
error from the current filer failed the catalog call even with another
healthy filer discovered. The catalog now gets an accessor of its own
over every filer the broker has discovered, the current one first, read
under the lock that guards them. The broker's shared accessor stays on
the current filer, so topic.conf, offsets and the subscriber coordinator
keep reading one filer as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: a topic leaves a table that no longer names it

A table dropped and replaced under the same name by one that does not
carry the topic's property holds none of the topic's history, so its
snapshots no longer keep the topic from detaching, switching tables, or
following a schema change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3tables: keep tableMetadata's doc comment on tableMetadata

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: walk the table catalog's filers in order, current first

FilerClientAccessor shuffles the filers it is given, so the catalog's
create, load and registration calls each went to a random discovered
filer even while the current one answered. A filer with its own store
may not yet hold what another just wrote. Try the current filer first
and move on to the others only when it fails, as the S3 gateway does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "mq broker: a topic leaves a table that no longer names it"

The property alone does not show the table was replaced: a
set-properties commit on the same table changes it and keeps the
snapshots, and the topic would then leave its history behind. Telling a
replacement apart needs the table's identity stored with the topic.

This reverts commit ddeb10a89b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mq broker: tell a replaced topic table from its own by UUID

A topic could not leave a table that was dropped and replaced at its
name by an unrelated table holding data: the snapshot guard refused to
detach or switch, and the ownership check refused to adopt. A changed
seaweedfs.mq.topic property does not prove a replacement, since a
set-properties commit keeps the same table and its snapshots.

TopicTable now carries the Iceberg table UUID, which the broker records
in topic.conf after it creates or adopts the table; a request cannot set
it. Requests are compared by bucket ARN, namespace and name only. When
the topic leaves its table, a loaded table whose UUID differs from the
recorded one is a replacement and is let go without the snapshot guard.
A matching UUID, or a topic.conf written before the UUID was recorded,
stays under the guard. Taking a table at the name still goes through
the ownership and schema checks.

Claude-Session: https://claude.ai/code/session_011Upvai5AjLiNE5B1HCAn34

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:48:29 -08:00
pingqiu 45f3482db6 feat: bind snapshot outcomes to guarded HEAD publications 2026-12-01 18:48:25 -08:00
pingqiu 0d1d36cd1f feat: persist snapshot operation receipts with fenced updates 2026-12-01 18:47:58 -08:00
pingqiu cbc1ee0671 test: cover snapshot observation and crash boundaries 2026-12-01 18:47:58 -08:00
pingqiu f9c1bb7d87 test: pin snapshot operation replay across removal and lost replies 2026-12-01 18:47:58 -08:00
pingqiu 435ce4802a fix: log retryable NVMe write failures with a target rate limit 2026-12-01 18:46:49 -08:00
Ping Qiu eed6b08bbc Merge pull request #894 from seaweedfs/feat/v8-list-codecs
Persist session-owned lists and their consumption cursor
2026-12-01 18:38:29 -08:00
pingqiuandClaude Opus 5.5 0726214734 storage: the upgrade pass rewinds to the earliest rebuilt page, not any unknown chunk
The open records the first chunk of the earliest page it rebuilt (the
kernel's cursor_back); the pass rewinds there, durably, before any request
is admitted. With no cursor a pass starts only after an unseeded upgrade
by this attach or a rebuilt page: chunks unknown only because they were
written after their page are dirty, and cuts take them, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:37:18 -08:00
Ping Qiu 3b1b3ef3ac Merge pull request #907 from seaweedfs/fix/precopy-rate-floor
storage: a pre-copy rate sample survives an upload below the clock tick
2026-12-01 18:30:31 -08:00
pingqiuandClaude Opus 5.5 9cf074d480 docs: format-gate invariants; v1.1 note: going back works until the format finalize
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:27:56 -08:00
pingqiuandClaude Opus 5.5 647ba06119 master: cluster format level (FORMAT-GATE): reads_level, finalize, level-0 v1.0 semantics, retire
Hosts report the format they read (heartbeat reads_level). The cluster's
format level is the master's attestation file's form: v1.0's bare map is
level 0, the envelope (format 2, format_level 1) level 1.

At level 0 the master keeps v1.0's semantics, so a v1.0.x master started
on the store stays safe: renewals clamp to the persisted horizon and an
extender keeps it current; forced moves and re-grants wait for the later
of horizon and deadline plus skew; records are envelope version 1.

sw-block cluster finalize-format raises the level in one durable step
(the envelope write), refused while a registered host has not reported
that it reads level 1; then the publisher switches under both its locks.
At any level no new work goes to a host that reads below it; its
heartbeat is refused binary_too_old; every assignment carries the level.
sw-block cluster retire-host removes a host that holds no volume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:27:53 -08:00
pingqiuandClaude Opus 5.5 bf9cec70ec hostlimit: test, a hand-off's idle bound is the skip window
TestOneStalledTicketCostsOneSkipNotEveryHandoff bounded each hand-off's
idle gap at a fixed 200 ms, which a loaded runner exceeded (295 ms). A
hand-off that paid the stalled ticket's skip idles at least the skip
window, so that is the bound now; the failure prints every gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:23:14 -08:00
pingqiuandClaude Opus 5.5 ead21f46b1 storage: the upgrade pass rewinds below its cursor; a write supersedes a compare
A page rebuilt at open leaves its chunks unknown again behind the pass's
cursor (completed or partial): the attach now rewinds the cursor, durably
and before the layer admits any request, to the first unknown chunk. A
chunk written between the pass's read and its hash is superseded by the
write: not hashed, not counted as compared, reported (Superseded); it is
dirty and the next cut takes it, also after a restart. A failed attach
joins the record writer it started. The pass tests hold the pass at a
barrier inside a compare instead of racing a timed walk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:23:14 -08:00
pingqiu 3a5381eebc Merge remote-tracking branch 'origin/main' into feat/v8-list-codecs 2026-12-01 18:19:51 -08:00
pingqiuandClaude Opus 5.5 a9724ba81e docs: the cut's candidate set by change
INV-WAL-V3-CAPTURE-CANDIDATES-TOUCHED-001 states the touched set and the
pre-barrier sync; the v1.1 notes carry them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:19:45 -08:00
Ping Qiu 3352749de7 Merge pull request #893 from seaweedfs/feat/v8-snapshot-generation
Add snapshot incarnation codecs and target-qualified delete helpers
2026-12-01 18:18:44 -08:00
pingqiuandClaude Opus 5.5 e1fb9cbd0d storage: the cut's candidate step judges a touched set, not every chunk
- The barrier's candidate step no longer walks the chunk map, nor the
  absent and clean-fill maps. It judges the members of a touched set, a
  chunk bitmap with a per-word summary (1 bit a chunk), with the same
  predicate the map scan used: (UNKNOWN and not known equal to HEAD) or
  above remoteLSN, minus absent chunks with no local write. The barrier
  takes the set by a pointer swap; readers (status, precopy, the record
  shadow) list a copy.
- The set is a superset of the chunks whose answer may have changed: every
  map entry change (OnMapEntryChange: a write's LSN, UNKNOWN by a direct or
  BASE mutation or a reused LSN), every version move, a HEAD install's
  changed refs (a whole install: the clean fills whose ref changed; a
  commit: its changed chunks), a recovery (every clean fill), and a
  once-per-layer seed on first use, outside the pause: every entry UNKNOWN
  or above remoteLSN, minus absent chunks with no local write.
- The cut syncs the store once right before its barrier, outside the
  pause (PreSyncNs, apart from BarrierPauseNs), so the pause's own sync has
  only what came after it.
- A test fixture that forgets clean-fill marks as a restart now touches
  those chunks, as a restarted layer's seed does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:07:24 -08:00
pingqiuandClaude Opus 5.5 a98d825054 storage: red tests, the cut's candidate set as an interval bitmap
- An idle cut's candidate step must visit at most the summary words plus a
  constant (counted, not timed) at 4,096 and 262,144 chunks (the 1 TiB SPACE
  shape); a one-chunk cut likewise (fails: the step visits every map entry,
  4,097 and 262,144).
- The cut must sync the store before its barrier, outside the pause, and
  report that time apart (fails: no sync before the barrier). A control
  checks the counter sees the pause's own sync.
- Guards, passing today and kept: an unknown commit outcome that did not
  land loses no chunk (its chunks and a later write are published by the
  next cut, nothing else changes); the candidate set's OR-back keeps the
  summary and each lists exactly the set bits.
- Seams: chunkCutStats.CandidateVisits, counting the candidate step's
  current visits, and PreSyncNs.

The candidate set type (a chunk bitmap with a per-word summary: set O(1),
walk O(C + S/4096), OR, clear) and the record runtime's take/return of it
come from an earlier parked branch, rebased onto the one-byte record codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:07:24 -08:00
pingqiuandClaude Opus 5.5 a6d1f4d93b storage: keep the floored payload sum out of the cut statistics
The tick-floored payload sum was an unexported field of ChunkCutStats, so
the layer statistics grew a field the cut body does not mirror (the
mirror test counts every field). The cut now keeps the sum locally and
hands it to samplePrecopy; ChunkCutStats is unchanged from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:06:22 -08:00
pingqiuandClaude Opus 5.5 bf548585e0 storage: tests of the upgrade itself attach with no compare pass after it
Tests that assert the record state an upgrade leaves (unknown chunks, a
seed, a crash at each step, a stale page) and the heap measurements now
attach with no compare pass (withoutUpgradePass): the pass would move the
state they read, or only slow a measurement of a large sparse volume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:49:13 -08:00
Ping Qiu aeb0078902 Merge branch 'main' into feat/v8-snapshot-generation 2026-12-01 17:41:24 -08:00
pingqiuandClaude Opus 5.5 409e7cb522 Merge main into fix/precopy-rate-floor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:40:40 -08:00
Ping Qiu 4655664cf5 Merge pull request #903 from seaweedfs/fix/cgroup-unresolved-fallback
blockvolume: an underivable cgroup memory limit starts on the default
2026-12-01 17:40:12 -08:00
pingqiuandClaude Opus 5.5 e73f30530e docs: regenerate the status schema for Stats.UpgradePass
The status schema's generated block comes from the code: the hand-written
rows are replaced by the generated ones, with the field comments on
UpgradePassStatus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:35:27 -08:00
pingqiuandClaude Opus 5.5 3ea35a5d5d storage: tests attach after the upgrade compare pass, unless they watch it
An attach after an unclean v1.0 upgrade runs the compare pass and refuses
cuts until it ends, so the attach helper now waits for it as it waits for
reconciliation (its own bound: a 262,144-chunk test volume takes seconds).
Tests that act while the pass runs opt out (withoutPassWait).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:33:54 -08:00
Ping Qiu a654ff23d0 Merge pull request #883 from seaweedfs/feat/v4b-pr4
storage: one-byte record kinds, the ref table, O(C) commits and no flat map on v1.1 (V4-B PR 4, commits 1-4 of 5)
2026-12-01 17:30:45 -08:00
Ping Qiu 72c2a63c33 Merge pull request #908 from seaweedfs/test/adopt-waits-frontend-ready
blockvolume tests: adopt waits for FrontendPrimaryReady before the first write
2026-12-01 17:25:23 -08:00
Ping Qiu f5444eb237 Merge pull request #895 from seaweedfs/feat/v5-incremental-build
authority: a heartbeat that changes nothing wakes no observation rebuild
2026-12-01 17:17:07 -08:00
Ping Qiu ce071bdbf1 Merge branch 'main' into feat/v8-snapshot-generation 2026-12-01 17:15:51 -08:00
pingqiuandClaude Opus 5.5 812fcffb35 storage: the attach runs the upgrade compare pass; sealing requests wait
After a v1.0 store's upgrade with no clean-stop seed every whole local
chunk is unknown. The v1.1 attach now runs the compare pass (resuming at a
persisted cursor, or starting when the record holds an unknown chunk); it
compares each unknown chunk with HEAD by the cut's own transitions. A stop
never waits for it: the pages and cursor of the work done are persisted
and the next attach resumes. Until it ends, a cut, snapshot, backup or
sealing detach is refused typed (ErrUpgradePassInProgress, HTTP code
in_progress) and the pass runs at full rate. Holder status reports
Stats.UpgradePass {State, Compared, Total, Outcome}.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:15:16 -08:00
pingqiuandClaude Opus 5.5 ccb9215f75 storage: red test, an unclean-stop upgrade leaves no unknown chunk after the pass
TestV11UncleanUpgradeLeavesNoUnknownAfterThePass: a v1.0.x store attached on
the v1.1 format with no clean-stop proof (an unclean stop) opens with every
whole local chunk unknown; the attach must then run the compare pass, which
leaves none unknown: chunks equal to HEAD end published with HEAD's hash, a
chunk that differs never with HEAD's hash. Fails on main: after 20 s all 16
chunks are still unknown, because the pass has no production caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:06:48 -08:00
Ping Qiu d14cf47fdf Merge branch 'main' into feat/v4b-pr4 2026-12-01 17:03:06 -08:00
pingqiuandClaude Opus 5.5 67f770d650 storage: floor each pre-copy payload interval, not their sum
The payload time sums several intervals (staging, the copy, the upload);
three that each ended below the clock's tick read zero although together
they took up to three ticks, so one floor on the sum overstated the rate.
Each interval now adds at least one tick to an unexported floored sum
that the rate divides by; the reported payload time is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:53:21 -08:00
Ping Qiu fb30cd8f80 Merge pull request #887 from seaweedfs/test/v11-format-tag
build: the draft v1.1 store format gets its own tag, apart from the cap lift
2026-12-01 16:52:06 -08:00