Commit Graph
899 Commits
Author SHA1 Message Date
pingqiu 2ce032e32e test(block-ci): cover masked whitespace in reference destinations 2026-12-05 08:16:19 -08:00
pingqiu 286cbf4ecb fix(block-ci): validate original destination syntax 2026-12-05 07:55:05 -08:00
pingqiu 9d19a1a516 fix(block-ci): preserve original link destination bytes 2026-12-05 07:44:32 -08:00
pingqiu 36d91b0cea fix(block-ci): preserve escapes and context when masking code 2026-12-05 07:35:17 -08:00
pingqiu 30e7ead741 fix(block-ci): require complete matching code-span delimiters 2026-12-05 07:22:19 -08:00
Chris LuandClaude Opus 5.5 3f356a0b21 fix(block-ci): publish the draft a rerun of block-release finds
An interrupted first run can leave the tag with an unpublished draft.
The rerun took the existing-release branch, replaced the assets and
exited 0 with the release still a draft. Publish after the uploads,
keeping it off the repository's Latest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 06:49:04 -08:00
Chris LuandClaude Opus 5.5 eeef10aeb2 fix(block-ci): mask code spans that wrap lines before matching links
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 06:48:56 -08:00
pingqiu 2c8d8d3a14 fix(block-ci): refuse ambiguous merge bases in readiness checks 2026-12-05 05:53:05 -08:00
pingqiu c06afc5a26 fix(block-ci): normalize artifact paths from both checker entry points 2026-12-05 05:50:09 -08:00
Chris LuandClaude Opus 5.5 0c510646dd block-ci: keep root block CI files clean under the public-text scan
The port test fixture spelled out a recorded-artifact path, and the unit
group test a pid literal, so the checker flagged both as added lines of
any PR that touches them. Build the fixture path from parts, name the
pid through a variable, and scan the root block CI files with the
checker's own pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:31:48 -08:00
Chris LuandClaude Opus 5.5 7c31672e4a block-ci: refuse host files in a labelled PR outside the allow list
Host paths went through the module allow list, where "*_test.go", "*.md"
and "docs/*" also match root files, so a labelled PR changing
weed/example_test.go or README.md passed. List host changes separately
and fail on any of them; the module list still runs. The port test now
runs the step in a scratch repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:31:01 -08:00
Chris LuandClaude Opus 5.5 27f97dd6d1 block-ci: test the root wiring the active workflows use
The nested self-tests read the module's inactive test.yml, deploy/
Dockerfiles and chunkstore-scope.sh. Assert the docs-only gates in
block-test.yml, that each root image refuses every binary it builds, and
that the root classifier selects run for chunkstore, storage and durable
edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:10:08 -08:00
Chris LuandClaude Opus 5.5 b3403d5da6 block-ci: match doc links per paragraph, with nested parentheses and long fences
A link whose label wraps onto the next line was never checked, a target
such as guide(v2).md was cut at its first ')', and a three-backtick line
inside a four-backtick fence closed it. Close a fence only with the same
character at least as long, keep one level of balanced parentheses in a
destination, and match links over each paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:09:42 -08:00
Chris LuandClaude Opus 5.5 3fd8862426 block-ci: keep the public-text adapter in step with the module checker
The root adapter carried the v1.1.0 signatures: it passed /home/<user>/
paths and run metadata, and an empty docs/spec/**/recorded-* artifact,
which the module checker refuses. Take the module's pattern and artifact
path check, keep module-relative paths, skip the root adapter's own
pattern when run from the root, and run the module self-test against the
adapter so the two cannot drift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:08:59 -08:00
Chris LuandClaude Opus 5.5 bb8c969709 block-ci: check host paths in a labelled post-merge-review PR
The changed-path list holds module paths and block controls only, so a
labelled PR that also changed host files passed on its module part. Add
every other changed path with its root name; the allow list refuses it.
The spec-trace scope stays module-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:08:02 -08:00
Chris LuandClaude Opus 5.5 25afda36b0 block-ci: refuse only control changes the PR itself makes
The two-dot diff against current master listed every block workflow master
changed after the PR branched, so an older docs-only PR hit
workflow_review_required for good. Diff from the merge base; the gate
already requires the tested base to be current master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:07:45 -08:00
Chris LuandClaude Opus 5.5 eec9517c87 block-ci: give each master push its own Block Test concurrency group
A group admits one running and one pending run; a newer push cancels the
pending one even with cancel-in-progress off, so a burst of merges left
some without a post-merge result. Key pushes on the commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:07:30 -08:00
Chris LuandClaude Opus 5.5 b52fd36f0a block-ci: list both sides of a move when planning unit packages
Without --no-renames a file moved out of core/storage/ shows only its new
path, so the planner skipped the package it left. The sibling scope scripts
already pass the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:07:24 -08:00
Chris LuandClaude Opus 5.5 d216bfda15 block-ci: let a release rerun replace the assets of a published tag
gh release create fails once the tag's release exists, after both image
pushes have already run again. Keep the imported helper's existing-release
path: edit the prerelease flag and upload with --clobber.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:07:23 -08:00
Chris LuandClaude Opus 5.5 3f21fa9549 block-ci: judge known bugs with the module helper; list only live reproductions
The inline loop called an empty -run match or a skip a fix, and the list
still named #188 (closed, test passes) and #189 (test absent), so every
nightly run failed. Use known-bugs.sh and its controls, as the module
workflow does, and keep only #186: #187's reproduction passes at this
revision because values.yaml sets blockmaster.stateHostPath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 04:07:06 -08:00
pingqiu 9a8a3b81fb fix(block-ci): refresh test evidence before reporting readiness 2026-12-05 01:37:50 -08:00
pingqiu 58347a55f0 ci(block): refuse workspace aliases before cleanup 2026-12-05 00:34:43 -08:00
pingqiu 12b9f2f037 ci(block): pin merge evidence and refuse control changes 2026-12-05 00:16:07 -08:00
pingqiu 9bdd7f25e0 ci(block): bound runner disk use and clean job workspaces 2026-12-04 23:56:51 -08:00
pingqiu 35c6faf789 ci: use the integrated root documentation link checker 2026-12-04 19:32:20 -08:00
Chris LuandClaude Opus 5.5 ed7592dc4d ci: run the block documentation link check from root scripts
The Relative documentation links step called .github/scripts/doc-links-check.py
and its test inside seaweed-block/, but neither the imported module nor
upstream seaweed-block has them, so the unit suite would fail once the step
runs. Add the checker and its test under .github/block/scripts/ with the
other port scripts and point the step and its contract test there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:22:24 -08:00
Chris LuandClaude Opus 5.5 915909cf6b ci: refuse a block release without notes before pushing images
The notes file was first checked in the last step, after both images
(and, for the highest stable tag, :alpha) were already pushed to GHCR, so
a tag without docs/releases/vX.Y.Z.md left the images published and no
GitHub release. Check it with the tag format, before anything is pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:21:27 -08:00
Chris LuandClaude Opus 5.5 fef4dbaaac ci: publish block releases from hosted runners
The release job holds contents: write and packages: write and logs in to
GHCR, and builds its images with the runner's Docker. Following
BLOCK_RUNNER_LABEL put it on the persistent pool that same-repository PR
test jobs also use, whose Docker and build cache those jobs can leave
state in, and whose Docker setup is still listed as unvalidated. The
source repository published from ubuntu-latest; keep that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:21:26 -08:00
Chris LuandClaude Opus 5.5 ed6d649794 ci: keep the block post-merge-review check on hosted runners
The job's own comment records that it ended in 'Set up job' with no log on
every self-hosted runner, and the source repository ran it on ubuntu-latest.
The port made it follow BLOCK_RUNNER_LABEL, so setting the variable would
bring that failure back for every labelled same-repository PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:21:25 -08:00
pingqiu 1776005e5b ci: check block documentation relative links 2026-12-04 19:12:07 -08:00
pingqiu b699a0dd01 ci: preserve policy self-exclusion at the root path 2026-12-04 19:06:49 -08:00
pingqiu 4762c84e43 ci: port block workflows to the shared repository 2026-12-04 19:06:49 -08:00
7bfb5b6784 mount: take a live mount over without unmounting it (#13382)
* go.mod: take seaweedfs/go-fuse from #5 until it is released

The handover builds on the server API of seaweedfs/go-fuse#5: Server.Stop,
Start and Shutdown, Server.Dev and NewServerFromDev. Until that pull request
is merged and tagged, go-fuse is replaced by its branch; the replace goes
with the release.

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

* mount: quiesce the background writers, pause and resume the metadata subscription, and give a takeover its own cache directories

The periodic metadata flush, the proactive chunk flush and the idle directory
eviction check a gate before each tick, so a handover can stop them and wait
for the work they run. PauseMetadataFollow and ResumeMetadataFollow end the
subscription and start it again from the position of the last event it
handled, with the filer.conf follower it had.

A successor keeps the subscription's client id (the signature crosses), so
it subscribes at an epoch above its predecessor's: the filer then replaces
the old subscription instead of refusing the new one as a duplicate and
making it wait for a retry.

A process that takes a mount over (Option.Takeover) uses <id>.t<pid> for its
read and swap directories, as the predecessor still uses <id>. A normal start
removes the stale <id>.t* siblings.

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

* mount: the handover protocol, old side and new side

A running mount listens on a unix socket (0600; the peer's uid is checked
with SO_PEERCRED on both ends, ours or root). A successor connects, says
hello, receives the FUSE fd with the INIT negotiation and the exported state,
answers ready, and is told go.

The hello carries the mount directory, the filer path and the options the
state depends on (writeback cache, routed locks, nfs export): the running
mount refuses a mismatch, a blocked lock request and a peer chunk server
before it flushes or pauses. A connection closed before its hello is a probe
(HandoverAnswers), logged at V(1).

Until go the old side rolls back at every step (pre-flush, quiesce, stop,
final flush, pause of the subscription, export, ready) and keeps serving: the
subscription restarts from its position, the background writers and the nfs
export writer resume, the server reads again. After go it closes its server
without unmounting and marks itself committed, so its exit leaves the mount
and the successor's sockets alone.

The fd is carried by a fixed-size header written with one sendmsg and read
with one recvmsg; control messages are length-prefixed JSON, and the state
stream and the go frame are read through one bufio.Reader.

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

* mount: a new mount on a live mount directory takes it over

A weed mount started on a directory that is mounted already, whose weed
mount answers on the handover socket, takes that mount over instead of
replacing it: open files, locks and working directories inside it carry on.

- Every Linux mount listens on a socket next to its local gRPC socket,
  <localSocket without .sock>.handover.sock, /tmp/seaweedfs-mount-<hash>.handover.sock
  by default; a deployment that keeps the local socket where the next mount
  process can reach it gets the same for this one. Not with -peer.enable,
  whose listen port has a single owner, nor with -filer.tokenFile, as read
  tokens and chunk proofs do not cross.
- Those mounts read /dev/fuse in the stoppable way.
- A new mount takes over when its directory is in the mount table and a
  process answers on the socket. When none answers (none runs, it crashed,
  it is an older weed), the mount proceeds as before.
- A takeover skips the pre-mount unmount and the mount point check, binds the
  local gRPC socket and the handover socket only after the old process said
  go, and uses cache directories of its own. One that does not go through
  exits non-zero and leaves the running mount serving; to mount anew, stop
  that weed mount or unmount first, as for a busy mount today.
- After go, a socket the new process cannot bind is logged, not fatal: the
  mount goes on without mount.configure or without a next handover, rather
  than going down.

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

* test: end-to-end handover test

test/fuse_handover starts a real weed mini and weed mount processes with the
same arguments, and lets each new one take the live mount over, twice in a
row and once more after a refusal. An appending writer, a streaming reader,
an mmap, an unlinked temp file, an unclosed new file, a directory walk and a
listing in progress, a held flock and POSIX lock, a process working inside
the mount and a renamed open file run through it. It checks that the mount
was never unmounted (mount id and st_dev), that the old processes exit 0,
that a takeover refused because a SETLKW is blocked, or because the options
differ, leaves the mount serving without a pause, and prints the pause.

With HANDOVER_SCALE_FILES=<n> a second test creates n files, takes the mount
over, and logs the pause and the size of the state. On a 2-vCPU VM: 10k files
18 ms and 360 KB, 100k files 134 ms and 2.9 MB, 300k files 410 ms and 7.1 MB.

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

* mount: answer the first review of the handover

The checks before anything pauses:
- The hello carries the filer addresses, sorted, and -defaultPermissions:
  the running mount refuses a successor of other filers (its open files and
  inode table name entries and chunks of this filer) or of another
  default_permissions (without it the kernel leaves the permission checks
  to the mount, and a successor that counts on the kernel would make none).
- A successor finds the live mount for a relative -dir and for a path with a
  space: the mount table is read with the absolute path, and its octal
  escapes (\040 ...) are undone, which checkMountPointAvailable gets too. The
  local socket keeps its name.

Rollback and commitment:
- A rolled back handover starts the FUSE server first. A subscription that
  did not end in time may wait for a request to be served, and the rollback
  waited for it before the server read again. The subscription now starts
  again in the background once the old one has ended; until then a new
  handover is refused before anything pauses.
- A successor reads the filer configuration (PrepareBackgroundTasks) before
  it connects, since a failure there after go would end the process with
  nobody serving the mount, and it does not create the mount root, which the
  running mount serves.
- A reconnecting subscription publishes its epoch, so that a later one with
  the same client id starts above it instead of being refused as a
  duplicate.
- A takeover's cache directories are <id>.t<pid>-<random>: two processes
  that each run as pid 1 of a container sharing the cache base got the same
  directory.

Tests:
- The protocol tests run on Linux only, as the protocol does; those of the
  background gate and of the cache directories run everywhere.
- The end-to-end harness bounds the probes that go into the mount, waits
  until the SETLKW helper sleeps in FUSE before it asks for a takeover,
  counts only complete reader passes, closes the retained files on failure,
  rechecks a log after its process exited, and cleans up only mounts below
  its own directory.

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

* mount: read the filer configuration again after a takeover

A successor reads the filer configuration before it connects, so that
nothing that can fail is left for after go. A change that the predecessor
applied in between does not come again with the subscription, which starts
where the predecessor stopped, and the successor kept the configuration it
had read. It now reads it once more when it starts its background tasks;
on failure the one read before stays.

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

* mount: build the moved handover tests where their helpers are

handover_quiesce_test.go uses newHandoverWFS, which is defined in a test
file built everywhere but on Windows; it gets the same constraint. The
mount readiness probe of the end-to-end test is also capped at the
remaining deadline.

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

* mount: renew the routed lock leases before the background tasks wait on the filer

A successor with -dlm holds the routed locks its predecessor took, and the
filer drops their leases 15 s after the last renewal. StartBackgroundTasks
began renewing only after it had read the filer configuration again, a
filer call that can take longer than that. The renewal now starts first.

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

* mount: compare -readOnly and -allowOthers in the hello, and drop a filer configuration that is gone

- -readOnly and -allowOthers are kernel mount options, fixed when the mount
  was made: a successor started with others would run with the old ones
  without knowing. The hello carries them and the running mount refuses a
  mismatch before anything pauses.
- The filer configuration read again after a takeover clears the one read
  before when the file is gone.

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

* test: close the held lock files of the handover workload on failure

The flock and POSIX lock files are opened before the takeovers and closed
in finish(); an assertion that fails in between left them open. They get a
cleanup right after they open, like the other retained files.

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

* mount: compare the kernel's mount options as -o sets them too, and retry the filer configuration read after a takeover

- allow_other, ro and default_permissions can come from -o as well as from
  their flags. The hello compared the flags only, so a successor started
  with -allowOthers=false could take over a mount made with -o allow_other.
  The mount now records the kernel's options from both (KernelReadOnly,
  KernelAllowOther, KernelDefaultPermissions), and the hello compares
  those.
- The read of the filer configuration after a takeover is tried three times
  before the subscription starts, which can wait: it starts where the
  predecessor stopped. Only if all fail does the configuration read before
  the takeover stay until its next change.

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

* mount: drop the WEED_MOUNT_HANDOVER_STOP_TIMEOUT test hook

The drain bound stays at its 10 s default; the end-to-end tests wait well
over that for a refusal, so they do not need a setting of their own.

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

* mount: close a descriptor that comes with a refused handover

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

* mount: take a mount over when the new process shares a filer with it

The hello required the sorted -filer list to match exactly, so a
successor started after filers were added to the cluster or taken out of
it was refused, and the old mount kept serving. A filer serves one filer
store: one filer in common means the store that the open files, the
inode table and the chunks belong to.

Compare the filers as host:port, as ServerAddress.Equals does, so that
an address written with its gRPC port counts as the same filer, and
refuse only lists with no filer in common.

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

* ci: run the FUSE mount handover end-to-end tests

test/fuse_handover starts a real weed mini and weed mount processes and
lets each new mount take the live one over; no workflow ran it, so only
the unit tests guarded the handover in CI. The job follows the FUSE DLM
one: it repairs the fusermount3 setuid bit, builds weed and runs the
tests with WEED_BINARY. The tests mount as the runner user without
allow_other, so fuse.conf is left alone. A failed run uploads the weed
logs, which the harness keeps in /tmp/fuse_handover_*.

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

* mount: compare the kernel's mount flags in the hello, resolved in order

The hello compared ro as "-readOnly or -o ro", and no other mount flag.
-readOnly puts ro before the -o options, and both fusermount3 and
go-fuse's direct mount apply the options in order, so -readOnly with
-o rw mounts read-write while the hello said ro. A successor started
with -o noexec, nosuid or nodev also got the old mount's flags without
knowing.

Resolve the generic flags from the option list go-fuse mounts with, in
order, from nosuid and nodev as both mount paths start, and refuse a
successor whose flags differ before anything pauses. relatime is left
out: the kernel uses it unless noatime or strictatime is set.

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

* mount: do not send a handover control frame the peer would refuse

writeControl sized its buffer from the encoded message without a bound,
while readControl refuses a frame over maxControlFrame. Refuse the
larger frame before allocating, as the reading side does (CodeQL
go/allocation-size-overflow).

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

* test: unmount the handover e2e mounts with fusermount when fusermount3 is missing

The harness detached leftover mounts with fusermount3 only. A fuse2 host,
such as CentOS 7 or an Alpine image with the fuse package, has only
fusermount, so the last step of TestHandoverEndToEnd failed there after
every handover had passed. Try fusermount3, then fusermount.

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

* go.mod: use go-fuse v2.9.6 instead of the branch of seaweedfs/go-fuse#5

seaweedfs/go-fuse#5 is merged and tagged v2.9.6, whose tree is the one
this pull request was tested with (1eec9a8). Drop the replace with the
fork and require the release.

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

---------

Co-authored-by: whitebear009 <whitebear009@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-12-04 11:18:31 -08:00
Chris LuandClaude Opus 5.5 b7536bd6f6 test: S3, versioning and FUSE integration tests for the postgres_flat filer store (#13255)
* test/postgres_flat: S3 against a filer on the postgres_flat store

A weed mini whose filer.toml enables postgres_flat in a schema of its own.
Objects, listings, copies, multipart uploads, versions and bucket deletion
are checked through S3 and against the rows of the bucket's table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* test/postgres_flat: a FUSE mount against the postgres_flat store

Files, a directory longer than a listing page, renames, hard and symbolic
links, tree removal and a bucket made through the mount, checked against the
rows, then read back by a second mount with an empty metadata cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* ci: run the postgres_flat S3 and FUSE tests against Postgres

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* ci: run the postgres_flat tests on pull requests to any branch

Like the S3 workflows, so a stacked pull request runs them too, and only
when the code they reach changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* test/postgres_flat: fail fast when weed mini or the mount exits

ProcessState is only set by Wait, which ran only at cleanup, so a mini
or mount that died at startup was noticed only at the 45s or 90s
deadline. Reap each command as it starts and check for its exit while
waiting.

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

* ci: run the postgres_flat tests on changes anywhere under weed/

The tests run master, volume, filer, S3 and a mount, so changes in
packages such as weed/pb, weed/wdclient or weed/credential reach them
too. Match the FUSE integration workflow and also trigger on the
fusermount action the job uses.

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

* test/postgres_flat: versioned buckets on the postgres_flat store

Versions and delete markers are rows under the key's .versions folder in
the bucket's table. Covers version listings in one page and one version a
page, delete markers, promoting the previous version, the null version
under suspended versioning, and dropping the table once every version and
the bucket are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* ci: run the S3 versioning suite on a postgres_flat filer

The whole test/s3/versioning suite, stress tests included, against a weed
mini whose filer.toml enables postgres_flat. The job first checks that
filemeta has the flat layout, so a filer on its default store cannot pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* test/postgres_flat: set up shared objects before the subtests

The S3 and versioning suites wrote their objects and the second bucket
inside the first subtest, so running one later subtest with -run left
the version ids empty and panicked. The parent test now writes them and
the subtests only check.

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

* test/postgres_flat: helpers fail the test that calls them

paths, tableExists, count, filerList, start and mount take the caller's
*testing.T, so a failure inside a subtest fails that subtest instead of
calling FailNow on the parent and stopping its siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* ci: wait for the filemeta table before the versioning suite

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

* test/postgres_flat: POSIX subtests set up their own fixtures

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

* test/postgres_flat: absent versions must answer 404

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 11:42:13 -08:00
Chris LuandClaude Opus 5.5 b1f86ddfa2 s3: support PutBucketDefaultStorageClass and GetBucketDefaultStorageClass (#13282)
* s3: add PutBucketDefaultStorageClass and GetBucketDefaultStorageClass

The setting is kept in the bucket entry's extended attributes next to
the other bucket configuration, so every gateway sees it through the
bucket config cache. Only STANDARD and INTELLIGENT_TIERING are accepted,
matching the AWS model; STANDARD clears the stored value.

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

* s3: give new objects the bucket default storage class

PutObject, POST uploads, CreateMultipartUpload and CopyObject store the
bucket default when the request names no storage class. The request
headers are left alone, so bucket-policy storage-class conditions and
the self-copy change check still see only what the client sent. Upload
parts are not tagged; a completed upload takes the class recorded when
it was initiated.

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

* s3: test the bucket default storage class APIs and write default

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

* s3: fail a write whose bucket default storage class cannot be read

A failed bucket config lookup used to fall back to STANDARD, so a write
could store a different class than the bucket default asks for. The
write now returns the lookup error instead. A request that names its
own class still needs no lookup.

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

* s3: give extracted ZIP directory members the bucket default storage class

Directory members are created through mkdir rather than putToFiler, so
they stored no class while the files next to them did.

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

* s3: reject a default storage class body with trailing data

The decoder stopped after the first element, so a valid configuration
followed by another element or stray bytes was accepted. The body is
now read with a size bound and only whitespace, comments or processing
instructions may follow the configuration.

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

* go.mod: bump aws-sdk-go-v2/service/s3 to v1.117.1

The release adds the PutBucketDefaultStorageClass and
GetBucketDefaultStorageClass client operations.

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

* s3: test the bucket default storage class through the AWS SDK

Covers get/set, an unsupported class, the setting stored in the bucket
entry and read back by a fresh bucket config, PUT, explicit classes,
multipart initiation, copy, existing objects, and per-API grants.

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

* s3: let each default storage class subtest set up its own state

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

* s3: assert the explicit STANDARD class exactly in the default class test

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

* s3: note that the bucket default storage class is a label only

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 04:05:48 -08:00
Chris LuandClaude Opus 5.5 9e4e1ade67 filer: conformance suite for filer stores, run against Postgres and MySQL in CI (#13250)
* filer/store_test: conformance suite for filer stores

Entries in and out of buckets, byte-ordered and prefixed listings,
key-value records, transactions, bucket tables and the snapshot scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* filer: run postgres2 and mysql2 through the conformance suite

RUN_POSTGRES_TESTS and RUN_MYSQL_TESTS enable them, as RUN_REDIS_TESTS
does the Redis stores; each test gets a schema or database of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* ci: give the go test job Postgres and MySQL services

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* filer/store_test: create the shared fixtures before the subtests

The scan and delete-folder-children subtests read the order directory that
only the list subtest created, so selecting either one with -run failed on
a conforming store.

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

* filer/store_test: roll back a transaction an assertion abandons

A failed assertion between BeginTransaction and the commit left the
transaction open with its locks, and the cleanup's DROP SCHEMA then waited
on them until the go test timeout.

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

* filer/store_test: check limited listings without trimming the result

The limit-1 checks sliced the listing to one name, so a store that ignored
the limit passed, and one that returned nothing panicked. Allow only the one
look-ahead entry the SQL stores return and compare the first name.

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

* filer/store_test: give the exclusive limit check three eligible names

Starting after a%b left only two names under the prefix, so a store that
ignored the limit still met the one look-ahead bound.

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

* filer/store_test: check that a bucket drop removes nested entries

A store that reports CanDropWholeBucket gets no recursive walk from the
filer, so its DeleteFolderChildren on the bucket has to remove every
descendant. With only a direct child in bkt2, a store that deleted the
direct children and kept the table passed.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:13:02 -08:00
0d3f81b771 volume(rs): refuse short JWT keys and skip Content-MD5 under fips.mode strict (#13206)
* volume(rs): refuse short JWT keys and skip Content-MD5 under fips.mode strict

Under fips.mode = strict the Rust volume server now does what the Go
volume server does under GODEBUG=fips140=only:

- At startup it exits when a JWT key in security.toml (any of the eleven
  jwt.signing* and jwt.filer_signing* settings Go checks) is shorter than
  the 14 characters FIPS 140 needs for HMAC keys, naming each one. Outside
  strict mode it warns about each such key but the previous ones.
- On SIGHUP, short current keys keep the keys in effect, and a short
  previous key is dropped, as in Go's Guard.UpdateSigningKeys.
- An upload's Content-MD5 is kept as the client sent it, unchecked, since
  strict mode computes no MD5.

The key rule and its messages live in seaweed-common's jwt_keys, so the
worker can use the same one.

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

* ci: run the fips140only cells in fips.mode strict, check strict refusals

The fips140only cells of the S3 digest matrix set WEED_FIPS_MODE=strict
beside GODEBUG=fips140=only, so the Rust volume server runs in the same
mode as the Go processes. A new job, test/s3/digest_matrix/negative_config.sh,
checks that master, filer and both volume servers refuse a 10-byte JWT key
at startup, that both volume servers keep a mismatched Content-MD5
unchecked, and that S3 answers a request signed with an 8-character secret
with an error.

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

* test: check the strict-mode Content-MD5 rule against both volume servers

TestWriteMD5MismatchKeptUncheckedUnderStrictFIPS starts the volume cluster
under GODEBUG=fips140=only and WEED_FIPS_MODE=strict and checks that an
upload with a mismatched Content-MD5 is stored with the client's value. It
sits in test/volume_server/http, so it runs against the Go volume server and,
with VOLUME_SERVER_IMPL=rust, against the Rust one. The same check leaves
negative_config.sh, which keeps the startup refusals.

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

* volume(rs): say which keys the strict-mode checks cover and what they do

The doc comments of the startup check, the reload rule and the jwt_keys
helpers now say which keys they check and what happens in each mode.

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

* volume(rs): an empty WEED_ variable leaves the security.toml value in place

env_string returned an empty variable as a value, so WEED_JWT_SIGNING_KEY=
replaced the key from security.toml with an empty one: the volume server
then checked no JWTs, and under fips.mode strict a short file key was not
refused, while Go's volume server exits with the same files. Go's viper
ignores empty variables; env_string now does the same for every WEED_
override.

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

* volume(rs): read security.toml with the TOML parser

The line reader missed quoted key names, multiline strings, dotted keys,
inline tables and spaced or quoted table headers, all of which Go's viper
reads, so a short JWT key written that way escaped the strict-mode check
and was not used at all. Settings are now looked up in the parsed table,
case-insensitively as viper does. A file that is not valid TOML is still
read line by line, as before.

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

* volume(rs): prefer the longest literal security.toml key, as viper does

Viper looks a dotted setting up longest name first, so a quoted
"jwt.filer_signing.key" key, at the top or under [jwt], wins over the
nested [jwt.filer_signing] key. The volume server read only the nested
one, so a short literal key passed the strict-mode check here while the
Go servers refused it.

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

* volume(rs): resolve security.toml key case collisions as viper does

Viper lowercases every key of a config file, and when two spellings
collide (key and KEY, or [jwt] and [JWT]) the one that is not lowercase
wins. The volume server matched names case-insensitively but took the
exact spelling first, so a short KEY next to a compliant key passed the
strict-mode check here while the Go servers refused it. The parsed table
is now lowercased the same way before any lookup.

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

* volume(rs): read an array or table security.toml setting as unset

Viper's GetString reads an array or a table as "", so the Go servers
skip a jwt key written as key = ["x"]. The volume server read its TOML
text instead, used it as the key and refused strict-mode startup over
it. fips.mode is still read as text: Go refuses a mode that is not a
string, and so does this server.

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

* volume(rs): keep each lenient security.toml line under its full name

A security.toml that is not valid TOML is read line by line, and those
lines went into nested tables, so a later scalar such as signing = "x"
under [jwt] replaced the [jwt.signing] table and erased its key. The
line reader ignored such lines before, and a SIGHUP reload of that file
would have installed an empty write key. Each line now goes in under its
full dotted name, which the longest-name lookup finds first.

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

* volume(rs): take the FIPS mode from the read that gives the JWT keys

Startup read security.toml once for the JWT keys and again for
fips.mode, so a file replaced between the two reads could pair the keys
of one version with the mode of the other and refuse to start over keys
that version never ran in strict mode with. The mode now comes from the
same parse as the keys; a file that exists but was not read is still an
error.

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

* volume(rs): read a float security.toml setting as Go's GetString does

GetString formats a float with the shortest digits and no exponent, so
key = 1234567890123.0 is a 13-byte key to the Go servers. The volume
server kept the TOML spelling with its .0 and measured 15 bytes, which
passed the strict-mode check the Go servers refuse.

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

* volume(rs): skip array-of-tables sections in a lenient security.toml

A file that is not valid TOML is read line by line, and lines under a
[[jwt.signing]] header went in under the same names as [jwt.signing],
so an empty key there replaced the real one, and a SIGHUP reload would
install it. The line reader now skips such sections up to the next
ordinary header, as the earlier reader did.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-12-01 15:33:31 -08:00
Chris LuandClaude Opus 5.5 480a1baa20 s3api: GetPart, reading parts of in-progress and completed multipart uploads (#13174)
* s3api: GetPart reads one part of a multipart upload

GET /key?part&partNumber=N&uploadId=X serves the latest attempt of an
open upload's part, or the bytes that part became in the object a
completed upload assembled, including a version that is no longer
latest. x-amz-multipart-upload-status says which. A Range counts
within the part, and a whole part answers 200 even though a completed
part is served as a range of the object.

The route sits ahead of ListParts and claims any ?part request, so a
missing partNumber is InvalidArgument rather than a listing, and the
request resolves to s3:GetObject, not the ListParts grant.

* s3api: reading an open upload's part needs s3:GetIncompleteUpload

AWS gates GetPart on an upload that has not completed behind
s3:GetIncompleteUpload on top of s3:GetObject, so a plain read grant
does not start exposing data its writer has not committed yet. The
action is its own legacy grant too; Read alone does not carry it, Admin
does. A completed upload's part needs only the read grant, plus
s3:GetObjectVersion when it lives in a version.

* s3api: a GetPart request carrying ?uploads is not a multipart listing

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

* s3api: GetPart answers a completed empty part with an empty 200

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:09:19 -08:00
dependabot[bot] 62d6127d6e build(deps): bump actions/download-artifact from 7 to 8 (#13169)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-30 12:47:15 -08:00
dependabot[bot] a07f774e6f build(deps): bump github/codeql-action from 4.39.4 to 4.39.5 (#13170)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.39.4 to 4.39.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.4...v4.39.5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-30 12:47:05 -08:00
dependabot[bot] b066c31172 build(deps): bump sigstore/cosign-installer from 4.1.3 to 4.1.4 in /.github/actions/sign-image (#13171)
build(deps): bump sigstore/cosign-installer

Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-30 12:46:53 -08:00
Chris LuandClaude Opus 5.5 6c54935723 java client, hdfs3: authenticate to a filer that requires filer JWT or Basic Auth (#13053)
* java client: read security.toml without an [https.client] section

toml.getBoolean returns null for a missing key, so unboxing it threw a
NullPointerException in the static initializer and every FilerClient
failed with ExceptionInInitializerError when security.toml held only
other sections, such as [grpc] or [jwt.filer_signing].

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

* java client: sign filer JWTs and hold [filer.basic_auth] credentials

FilerSecurityContext reads jwt.filer_signing.key, jwt.filer_signing.read.key
(with their expires_after_seconds, defaulting to 10 and 60 like the Go
clients) and [filer.basic_auth] from security.toml, with setters to set
them in code. getFilerAuthorizationHeaderValue returns the credential for a
request to the filer's HTTP port: an HS256 token for the access level,
minted like security.GenJwtForFilerServer, else the filer Basic Auth, else
the existing [basic_auth] value.

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

* java client: send the filer credential on filer-proxied chunk requests

With volume server access through the filer proxy, chunk reads and writes
address the filer's HTTP port, which checks the filer JWT or Basic Auth
before proxying. The write sent the AssignVolume token instead, which the
filer rejects with "wrong jwt", and reads sent no filer token. Send the
filer credential on proxy URLs only; direct and publicUrl volume requests
keep the volume token. With no filer credential configured, the old
headers are sent unchanged.

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

* hdfs3: take filer JWT keys and Basic Auth from the Hadoop configuration

fs.seaweed.filer.jwt.signing.key, fs.seaweed.filer.jwt.signing.read.key
(and their expires.after.seconds) and fs.seaweed.filer.basic.auth.user /
password override security.toml. The secrets are read with
Configuration.getPassword, so a Hadoop credential provider can hold them.

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

* hdfs3: document a filer secured with JWT or Basic Auth

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

* java client: fail a chunk fetch that answers a non-2xx status

doFetchOneFullChunkData returned the response body whatever the status,
so a 401 "wrong jwt" or a 404 JSON error was taken as chunk data and
cached. Throw instead, so the fetch tries the next location and reports
the error.

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

* java client, hdfs3: accept filer Basic Auth with an empty user

The filer turns Basic Auth on whenever the password is set, user empty or
not. The client dropped credentials without a user, so a password-only
filer refused every proxied chunk request.

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

* hdfs3: point the secured filer docs at [https.client]

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

* java client, hdfs3: keep filer credentials on each filer client

The filer JWT keys and [filer.basic_auth] lived in process-wide fields,
so a second filesystem with its own fs.seaweed.filer.* options replaced
the credentials of the first one, and a filesystem without options
inherited the previous overrides. Each FilerClient now copies the
security.toml values into its own FilerCredentials, and chunk reads and
uploads use the credentials of the client that issued them.

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

* hdfs3: let each filer credential option override only its own value

A password-only or token-lifetime-only option in core-site.xml was
ignored or dropped the security.toml user and key. Each option now
replaces just the security.toml value it names.

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

* hdfs3: show [https.client] for a secured filer and per-option overrides

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

* hdfs3: note that [https.client] does not check the filer host name

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

* hdfs3: check filer tokens against the configured key and lifetime

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

* java client: do not follow redirects on filer proxy chunk requests

HttpClient copies the request's Authorization header onto a followed
redirect, even to another origin, so a relayed 3xx would hand the filer
JWT or Basic credential to the redirect target. A 3xx now fails like any
other non-2xx answer and the read moves to the next location.

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

* hdfs3: close the filer client when credential options fail

A credential provider error or a malformed lifetime option threw out of
the store constructor after the client had opened its gRPC channels,
leaving them open on every failed initialization.

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

* hdfs3: say the filer HTTP credentials apply only to filerProxy mode

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

* java client: pick filer credentials by access mode and filer address

The proxy check matched any URL containing proxyChunkId=, so a volume
url or publicUrl carrying that text would receive the filer JWT or Basic
credential. Only filerProxy-mode URLs that start with this client's own
filer proxy prefix count as filer requests now.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:50:04 -08:00
Chris LuandClaude Opus 5.5 2ce8b75b3f ci: refresh the apt index before installing musl and cross toolchains (#13075)
The runner image's package index can name versions the mirrors have
already dropped, so apt-get install fails with a 404 on the first
security update after the image was built.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 17:51:52 -08:00
dependabot[bot] 8df718eaf3 build(deps): bump actions/dependency-review-action from 5.0.0 to 5.0.1 (#12929)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/a1d282b36b6f3519aa1f3fc636f609c47dddb294...bbc44d14a204704ccc493733616cd1e93a0321ec)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-27 15:04:34 -08:00
bf0da715fc ci: keep dev builds published and document them (#13059)
* ci: keep dev builds published and document them

The dev release was emptied before every build: the cleanup job deleted
all weed-* assets first, and cancel-in-progress cancelled the build on
the next master push. Build the platforms with one prepare timestamp,
upload first, then prune assets from older builds. Queue runs instead
of cancelling them, and allow manual runs from master only.

Document the dev binaries and the :dev container images in the README
and docker/README.md.

Refs #5009

* ci: key dev build concurrency by ref

A workflow_dispatch from another branch joined the single dev group and
replaced the pending master run before failing its ref guard, so the
newest master commit was never built.

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

* ci: keep newer dev builds when an older run retries

A "Re-run failed jobs" of an older run keeps that run's BUILD_TIME, so
its prune treated a newer complete build as stale and deleted it. Prune
now deletes only assets whose stamp sorts before BUILD_TIME.

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

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:59:44 -08:00
dependabot[bot] 977513cf35 build(deps): bump github/codeql-action from 4.39.3 to 4.39.4 (#12930)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.39.3 to 4.39.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.3...v4.39.4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-27 08:55:12 -08:00
e9a5d733b1 weed: report host THP policy; build: declare Go 1.27.4 to match the releases (#13025)
* weed: report the host transparent huge page policy at startup

Go maps the heap with MADV_HUGEPAGE, so the host THP policy applies to a
SeaweedFS process whether or not the operator asked for it, and the advice in
the Go GC guide depends on the heap size. Operators had no way to see which
mode a node actually runs in.

Log enabled/defrag/khugepaged.max_ptes_none once at startup from the
long-running commands, and print the Go toolchain in `weed version` so a
support bundle identifies the runtime that produced the binary. Nothing
changes the policy: THP is host-wide, and GODEBUG=disablethp=1 remains the
only per-process control.

Refs #5437

* build: declare Go 1.27.4, the toolchain the releases already use

The 4.55 release binaries report go1.27.4 (`go version -m` on the published
tarball), while go.mod still said 1.26.6, the Dockerfiles pinned golang:1.26,
and the release workflows left the Go version to the action default of "the
latest stable at build time". A source build, a container and a downloaded
tarball therefore ran different toolchains from the same tag, and the next
release could silently pick up another one.

Set the go directive to 1.27.4 in the root module and in the four modules that
build in CI, bump the 16 Dockerfiles, and pin goversion: 1.27.4 in the 16
release and dev action steps.

`go mod tidy` now emits the two require blocks Go 1.27 expects; no dependency
version changed. Go 1.27's gofmt realigns 8 files.

* weed mini: report the THP policy after quieting stderr

The startup line ran from the dispatch point before runMini applied
quietMiniLogs, so every weed mini start on Linux printed it to stderr,
which mini keeps for the welcome banner, warnings and errors. Log it
from runMini after quietMiniLogs so it lands in the log file only.

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

* util: report whether the Go heap can use huge pages

The runtime advises only GC metadata with MADV_HUGEPAGE and leaves the
heap arenas to the host default, so under enabled=madvise the heap stays
on small pages. The log still printed go_heap_disabled=false there, which
reads as "the heap uses THP". Report go_heap_thp, true only under
enabled=always without GODEBUG=disablethp, and drop the struct comment
that said the heap is mapped with MADV_HUGEPAGE.

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

* util: count an inherited PR_SET_THP_DISABLE in go_heap_thp

A launcher can disable THP for the process with prctl, and children
inherit it, so enabled=always alone does not mean the heap gets huge
pages.

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

* util: read GODEBUG disablethp the way the runtime does

The runtime applies GODEBUG left to right, so with
disablethp=1,disablethp=0 the heap keeps THP, while the helper stopped at
the first disablethp=1. The helper also missed other nonzero values such
as disablethp=2, which the runtime treats as disabled, and trimmed spaces
around keys, which the runtime keeps. Take the last disablethp with an
integer value, treat any nonzero value as disabled, and match keys
exactly. The parser now takes the GODEBUG string, so it is tested without
changing the environment.

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

* util: honor per-size THP policies in go_heap_thp

Since Linux 6.8 each anonymous huge page size has its own policy in
hugepages-<size>kB/enabled, and only "inherit" follows the top-level
knob. A 64kB size set to "always" gives the unadvised heap huge pages
under a top-level "madvise" or "never", and a 2048kB size set to "never"
takes them away under "always", but the log judged only the top-level
value. Read the per-size policies and report go_heap_thp=true when any
size reaches the heap. Under a top-level "never", the "disabled by the
host" line is now printed only when no size reaches the heap.

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

* util: report go_heap_thp=unknown when the process setting is unreadable

If PR_GET_THP_DISABLE fails, for example because a seccomp profile
rejects it, the process THP setting is not known, but the log treated it
as allowed and could print go_heap_thp=true. Print go_heap_thp=unknown
in that case. It stays false when the host or GODEBUG already rules out
heap huge pages.

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

* util: report go_heap_thp=unknown when a per-size THP policy is unreadable

An unreadable hugepages-<size>kB/enabled was skipped, so the log could
say the host disabled THP while that size allowed it. Keep it as an
empty mode and report unknown unless a readable size already allows
huge pages.

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

* ci: take the Go version from go.mod in tests and releases

posix-compliance pinned GO_VERSION 1.26 and built go 1.27.4 modules only
through the GOTOOLCHAIN auto-switch; nine workflows used go-version ^1.26 and
the kafka jobs ran in golang:1.26-alpine. Read the version from go.mod with
go-version-file, as the other setup-go steps already do, moving checkout ahead
of setup-go where it came after so the file exists. The posix report takes the
version from the setup-go output.

The release and dev builds pinned goversion 1.27.4 in 16 places. The pinned
go-release-action reads the go directive when goversion is go.mod, so the
binaries now follow go.mod without a second copy of the version.

* weed: report the THP policy from every long-running command

mount, worker, iam, master.follower, the filer sync/backup/remote/replicate
daemons and the mq agent and kafka gateway keep serving after startup like
the commands already listed; mount is likely where heap size matters most.

fuse is not listed: its first process starts a child with the same arguments
and waits, so logging at dispatch would print the line twice. It logs in
runFuse just before handing over to runMount, which only the child reaches.

---------

Co-authored-by: Konstantin Lebedev <whitefox@mayflower.work>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 08:36:36 -08:00
73e335a073 test/s3: run rclone fstests in CI with an expected-failures list (#13013)
* test/s3: result checker for rclone fstests

* test/s3: run rclone fstests against SeaweedFS with expected failures

* ci: add rclone fstests workflow

* test/s3: catch parent-only failures and panics in rclone fstests check

* test/s3: check parent assertions and skips in rclone fstests, widen paths

* test/s3: drop issue numbers from the rclone expected-failures notes

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

---------

Co-authored-by: Konstantin Lebedev <whitefox@mayflower.work>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:32:38 -08:00
ff80650b85 feat(helm): optional volumeAttributesClassName on every PVC (#12996)
* feat(helm): optional volumeAttributesClassName on every PVC

The chart's claims only take storageClass, size and annotations, so
provisioned performance (IOPS/throughput on GKE Hyperdisk, EBS gp3,
Azure Premium v2) can only be set through a custom StorageClass. A
VolumeAttributesClass is the Kubernetes way to do that and can be
changed later without recreating the volume.

Every claim the chart renders now takes an optional
volumeAttributesClassName next to its storageClass: master.data/logs,
filer.data/logs and the deprecated filer.volumeAttributesClassName,
admin.data/logs, volume.dataDirs[]/idx/logs (and volumes.<name>), and
allInOne.data. It is rendered only when set, so default renders are
unchanged.

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

* helm: quote volumeAttributesClassName so names like 2026 or null stay strings

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

* helm: say existing claims need a patch to change their volumeAttributesClassName

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-11-25 13:13:58 -08:00
f7b70d477d ci: run the S3 suites in every digest mode with both volume servers (#13000)
* ci: run the S3 suites in every digest mode with both volume servers

The sha256 digest (-filer.digest=sha256) and GODEBUG=fips140=only had no
S3-level CI run, and the Rust volume server none in any digest mode.
s3-digest-matrix.yml builds weed with GOFIPS140=v1.0.0 and weed-volume once,
then runs the basic ceph s3-tests list and the etag and checksum Go suites in
md5, sha256 and fips140only cells, each with the Go and the Rust volume
server and JWT signing on. test/s3/digest_matrix/start_cluster.sh starts a
cell's cluster.

The basic ceph test list moves to test/s3/compatibility/s3tests_basic.txt,
shared with s3tests.yml. The etag suite computes expected ETags with
util.NewMd5For(S3_DIGEST), so it checks each cell's digest; the checksum
suite skips SHA-1 when S3_FIPS140_ONLY=1. Three ceph tests whose answer the
mode changes on purpose are deselected in the cells of that mode.

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

* ci: run the digest matrix when the protos or the S3 fixtures change

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

* test: keep newTrailerChecksumClient's doc comment on its function

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-11-25 12:47:24 -08:00