* 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>
* feat: set GOMEMLIMIT from cgroup memory limit via automemlimit
* weed: set the memory limit before dispatch and report it through glog
The blank import ran memlimit.Set in an init with slog.Default, so every
weed command, including weed version and weed shell, wrote to stderr
outside glog, and macOS and Windows printed "failed to set GOMEMLIMIT:
cgroups is not supported" each time. Call memlimit.Set before running the
command instead, and log the resulting limit or a bad AUTOMEMLIMIT value
next to the transparent huge page line of long-running commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: log the -memoryLimitMB override and document the automatic limit
weed mount now starts with 90% of the cgroup memory limit unless GOMEMLIMIT
is set, so -memoryLimitMB=0 no longer means unlimited inside a container.
Say so in the flag help and log the override, which replaces the limit the
startup line reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Rajesh Kannapalli <rajesh.kannapalli@broadcom.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump parquet-go to v0.33.0
parquet-go v0.33.0 fixes several bugs that Iceberg compaction runs into:
- BOOLEAN columns that Arrow and parquet-mr write with data page v2 are
RLE-encoded. v0.32.0 decoded such runs wrong (a run's value byte expanded
bit by bit, runs taken as multiples of 8 values), so compaction rewrote the
flags wrong, and it wrote its own runs of trues with the value byte 0xFF,
which DuckDB refuses to read ("Payload value bigger than allowed")
(parquet-go/parquet-go#617, fixed by parquet-go/parquet-go#620).
- A column chunk without a dictionary lists the level encoding RLE next to
PLAIN. v0.32.0 took RLE as the column's encoding, so the schema derived from
a non-dictionary INT32 or DATE file could not write ("RLE: cannot encode
INT32 with invalid bit-width=0") and such files never compacted
(parquet-go/parquet-go#603, fixed by parquet-go/parquet-go#611).
- The sorting writer dropped the row groups' geospatial statistics when a
bin fit in its sort buffer, so a sorted rewrite of a geometry table wrote
files without a geometry bound (parquet-go/parquet-go#627, fixed by parquet-go/parquet-go#693 and parquet-go/parquet-go#700).
- A null in a list of required values wrote no value and shifted the rest of
the page (parquet-go/parquet-go#616, fixed by parquet-go/parquet-go#618); a short data page read leftover
values from a pooled buffer instead of failing (parquet-go/parquet-go#624, fixed by
parquet-go/parquet-go#731).
- A geometry or geography column declared without a CRS is now written
without one rather than with OGC:CRS84 spelled out (parquet-go/parquet-go#628, fixed
by parquet-go/parquet-go#688).
Changes that follow from the bump:
- A corrupt data page now fails with an error rather than a panic. The
position and equality delete readers returned that error without the file
name; they now name the file, as the data file merge already does.
- The default-CRS tests built their "spelled out" inputs with
parquet.Geometry(""), which now writes no CRS; they declare OGC:CRS84
explicitly. The footer rewrite in geometry_crs.go is still needed when an
input spells the default out, since the output schema comes from an input.
Tests:
- compact_rle_boolean_test.go with four pyarrow fixtures: two files with
v2-page RLE booleans (with nulls) read back and compacted with every flag
kept, and two non-dictionary INT32/DATE files compacted with every value
kept. All three tests fail on v0.32.0 (3005 of 6000 flags wrong; "no bins
successfully compacted").
- TestCompactSortedGeometryBoundCoversEveryRow only checked a bound when
there was one, so it passed with the statistics dropped. It now requires a
geometry bound on the data file and geometry statistics in the footer; it
fails on v0.32.0 and passes on v0.33.0.
- go vet and go test of every package that imports parquet-go
(weed/admin/dash, weed/mq/logstore, weed/mq/schema, weed/query/engine,
weed/worker/tasks/iceberg) pass; -race on weed/worker/tasks/iceberg and
weed/mq/logstore passes; go build ./weed passes.
* iceberg: fail the Arrow fixture tests on a read error
Both row-reading loops ended on any error, so rows decoded next to an
error could still pass the value checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* iceberg: check each fixture row comes out of compaction exactly once
A row replaced by a copy of another kept the row count and passed the
value checks, which use the row's own id.
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>
* mount: update go-fuse for the export support option
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: optionally retain the paths of forgotten inodes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: answer lookups of "." and ".." for file handle decoding
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: add -nfsExport to negotiate export support and retain forgotten inodes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: test file handle lookups of "." and ".."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: fail a file handle lookup when its path now holds another file
A "." lookup resolved a forgotten inode by its remembered path, so a
file created at that path since was served to the old handle. Compare
the entry's inode with the handle's and answer ESTALE on a mismatch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: register a file handle's inode under the table lock
A "." lookup checked the file at the remembered path and then registered
it with Lookup, which hands back whatever inode holds the path by then.
LookupHandle takes the reference on the handle's own inode, or enters it
at the path only while no other inode holds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: keep a forgotten inode's retained path across a rename
A rename whose source inode the kernel had already forgotten left the
retained path at the old name, so its file handle failed with ESTALE.
An index from retained path to inode lets MovePath move it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: register a file handle only at its current retained path
A rename between resolving a forgotten inode's path and registering it
moved the retained entry, yet LookupHandle still entered the old path.
It now compares the path with the retained one under the table lock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: drop the target a forgotten inode is renamed over
Moving a forgotten inode's retained path onto a live name left the
replaced inode mapped there. Once a retained entry moves, the target is
taken apart as for a live source and reported as replaced.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: test that a renamed path-inode file fails its file handle closed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* go.mod: use the go-fuse v2.9.5 release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* build(deps): bump golang.org/x/term from 0.47.0 to 0.48.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.47.0 to 0.48.0.
- [Commits](https://github.com/golang/term/compare/v0.47.0...v0.48.0)
---
updated-dependencies:
- dependency-name: golang.org/x/term
dependency-version: 0.48.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* telemetry: tidy go.mod for golang.org/x/sys v0.50.0
The x/term bump raises x/sys in the root module, which telemetry/server
replaces, so its build failed with "updates to go.mod needed".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump seaweedfs/raft so the leader quorum check follows the election timeout
A single master resuming raft state self-elects on a 1 ms election
timeout and restores the configured one afterwards, but the leader kept
running its quorum check every 1 ms for the rest of the process. The
raft change re-arms that check from the current timeout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump seaweedfs/raft to the raft PR head with the extended test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump seaweedfs/raft for the non-positive election timeout guard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump seaweedfs/raft so a timeout change re-arms the leader quorum check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* deps: pin seaweedfs/raft v1.2.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* master: keep the hostname out of raft metric names
go-metrics prefixes gauge names with the hostname by default, which gives
every master its own metric family, e.g. SeaweedFS_<host>_raft_peers.
Prometheus already tells masters apart by the scrape target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: send Hashicorp raft metrics through the go-metrics global raft uses
hashicorp/raft and raft-boltdb report through github.com/hashicorp/go-metrics,
but the master set up its prometheus sink on the armon/go-metrics global,
so a -raftHashicorp master exported no raft metric families. The sink is now
registered on the hashicorp/go-metrics global, and armon/go-metrics is no
longer a dependency.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: chart raft commit time and leader contact
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: keep the cluster in the raft panels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: average raft commit time and leader contact over the rate window
The go-metrics summaries keep quantiles for 10s, so a p99 scraped every
30s misses most observations. The _sum/_count rates count every sample.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: leave raft panels empty when nothing was observed
Clamping the count rate plotted 0 ms for windows without commits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: let the raft metrics test use its own registry
Registering on stats.Gather made go test -count=2 fail with a duplicate
collector registration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: register raft metrics before opening the raft stores
raft.NewRaft starts its run loop before returning, so registering the
sink afterwards could drop the first state and boltdb samples.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* deps: bump seaweedfs/raft for PreVote
The default raft gains the pre-vote phase so a master returning from a
partition can no longer depose a healthy leader with an inflated term.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* deps: bump seaweedfs/raft for pre-vote review follow-ups
Picks up the post-merge fixes on top of f227dce: per-round vote workers with per-peer dedupe, pre-vote grants counted at a newer term so mixed-version clusters cannot livelock, and state/conf field locking on the startup paths.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* deps: pin seaweedfs/raft to released v1.2.3
PreVote has merged and shipped as raft v1.2.3, so switch off the
PR-branch pseudo-version.
---------
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The pinned dev snapshot (v1.85.0-dev.0.20260915183914) predates
grpc/grpc-go#9563, which fixes the control-buffer throttle deadlock
(grpc/grpc-go#9330) that wedges weed mini under concurrent S3 writes
over unix sockets.
Verified with the issue's standalone repro (one ClientConn over a unix
socket, concurrent unary RPCs): the old snapshot deadlocks at c=512
after 743 RPCs; the new snapshot completes 3.06M RPCs/20s at c=512 and
1.97M/15s at c=2048 with no stall -- above the v1.82.0 pre-regression
baseline of ~112k ops/s.
CI installs the templ CLI with `@latest`, which now generates code
calling templruntime.NewAttributeExpression — a symbol added after the
v0.3.1070 runtime pinned in go.mod, breaking `make install` builds on
clean runners. Bump the runtime to v0.3.1100 and regenerate.
Brings in the raft snapshot-recovery fixes: a recovered follower returns
to Follower so it can campaign when the leader goes away (masters on
ephemeral -mdir no longer wedge leaderless), and currentTerm stays
monotonic and persisted through recovery.
* build(deps): bump github.com/Azure/azure-sdk-for-go/sdk/storage/azblob
Bumps [github.com/Azure/azure-sdk-for-go/sdk/storage/azblob](https://github.com/Azure/azure-sdk-for-go) from 1.8.0 to 1.8.2.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.8.0...sdk/azidentity/v1.8.2)
---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/storage/azblob
dependency-version: 1.8.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* test: restore loadBucketMetadataFromFiler stub after TestGetBucketMetadata
TestGetBucketMetadata replaced the package-level loadBucketMetadataFromFiler
with a stub that sleeps one second per load and never restored it. Every
test running after it in the same binary paid that sleep on each bucket
metadata cache miss: TestPutObjectUploadACL (~245s) and
TestCopyObjectDestinationACL (~46s) each created a fresh BucketRegistry per
subtest, so the stub fired hundreds of times. In CI this stretched the
Test job past 11 minutes and left it exposed to runner cancellation.
Restore the real loader via t.Cleanup so the slow stub is scoped to the
test that needs it.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>