mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
413fdf196883eda31f16d517bc66cd2d5537e732
16537
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
413fdf1968 |
admin: list the EC balancers that are active at the same time
The plugin ec_balance job, the legacy maintenance manager's ec_balance task and an admin_script job that runs ec.balance -apply each plan shard moves from the same topology without knowing about the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
97a6daa2a6 |
admin/maintenance: report whether the running manager queues a task type
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e01133bfa3 |
ec_balance: keep node addresses out of the task ID so tasks can be persisted (#13062)
* ec_balance: keep node addresses out of the task ID The ID embedded both host:port node addresses, and the admin's task persistence rejects any ID containing ':', so every ec_balance task failed to save on each state change and lived only in memory. The volume, shard, timestamp and index already make the ID unique; the nodes stay in the task's Reason and params. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: test that a detected ec_balance task saves and loads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
77333a5578 |
s3: match copy-source ETag conditions with the shared helper (#13054)
* s3: match copy-source ETags as the read and write paths do validateSourceConditionalHeaders compared the source ETag to the header value with strings.Trim, so x-amz-copy-source-if-none-match: W/"<etag>" did not match and an unchanged source was copied instead of answered with 412. An If-Match list that contained the source's ETag was rejected for the same reason. RenameObject shares the helper, so x-amz-rename-source-if-* behaved the same way. Use util.ETagListMatches, which the GET and PUT paths already use: strong comparison for If-Match, weak for If-None-Match, and the quoted tag lists RFC 9110 allows. * s3: drop the history comment from the copy-source ETag checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: skip the truncate manifest test on freebsd like its fake filer 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> |
||
|
|
397a156104 |
security: a fips.mode setting that Go checks against GODEBUG and the Rust binaries apply to TLS (#13029)
* util: refuse to start when fips.mode in security.toml disagrees with GODEBUG security.toml gains [fips] mode = "off" | "on" | "strict", also settable as WEED_FIPS_MODE: one setting that states the FIPS 140-3 mode of every process in a deployment, so the Rust binaries, which do not run on the Go runtime, can follow it. Go processes keep taking their behaviour from GODEBUG=fips140 and now check it against the setting: LoadSecurityConfiguration and `weed worker` exit when "off" runs without fips140=off, "on" without fips140=on, or "strict" without fips140=only, naming the setting and the GODEBUG value it needs. An unknown value is refused; unset or empty changes nothing. Refs #12839 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rust: fips.mode with FIPS-mode TLS in weed-volume, weed-worker and weed-vector seaweed-common gains a fips module: FipsMode resolved from fips.mode in the security.toml a binary uses, with WEED_FIPS_MODE over it. Each binary resolves it once at startup, logs it and installs the matching rustls provider as the process default, refusing to start on an unknown value or when another provider was installed first. Under "on" and "strict" the provider is aws-lc-rs filtered to the lists Go's crypto/tls applies in FIPS mode: TLS 1.3 AES-GCM suites and TLS 1.2 ECDHE AES-GCM suites (no ChaCha20-Poly1305), X25519MLKEM768, SecP256r1MLKEM768, P-256 and P-384 (no plain X25519), Go's ten signature schemes (no ML-DSA). Configurations SeaweedFS builds require the Extended Master Secret in that mode, and the volume server refuses a non-FIPS suite in tls.cipher_suites instead of falling back. sw-client installs the same provider instead of ring. Unset or "off" keeps aws-lc-rs's default provider unchanged. This is behavioural parity only: the provider still runs on the non-validated aws-lc-rs build. Refs #12839 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: refuse a fips.mode that is not a string viper's GetString turns an array or a table into "", so mode = ["strict"] under [fips] skipped the GODEBUG check while the Rust binaries refused the same file. RequireFipsMode now reads the raw value (ViperProxy.Get, under its lock) and exits when it is not a string, naming its source; an absent or empty value still means unset, and WEED_FIPS_MODE still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rust: read fips.mode with the parser that reads the JWT keys seaweed_common::fips::resolve parsed security.toml with the toml crate, while the volume server reads the rest of the file with its own lenient loader. A file with [fips] mode = "on" beside an unquoted value the loader accepts resolved to off and logged "fips.mode unset", although the JWT keys from the same file were applied. Each binary now reads fips.mode with the loader it uses for everything else and hands the value to resolve: the volume server through its line parser, the worker and vector engine through their parsed Security table, which already refuses a file that is not TOML. A security.toml the volume server finds but cannot read stops startup. A missing setting is still off, and WEED_FIPS_MODE still wins. seaweed-common no longer depends on toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sw-client: offer only FIPS signature schemes with insecure_skip_verify With https.client.insecure_skip_verify, reqwest installs its own verifier, which advertises a fixed scheme list including SHA-1 and Ed448 whatever the process provider allows. In FIPS mode the volume transport now builds its rustls configuration itself on the process provider: the server certificate and host name are not checked, as the setting asks, but handshake signatures are verified with the provider's algorithms, only its schemes are offered, and TLS 1.2 requires the Extended Master Secret. Outside FIPS mode the reqwest path is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-common: sign only with Go 1.27's FIPS schemes, allow ML-DSA The FIPS provider kept aws-lc-rs's key provider, so a FIPS-mode listener signed handshakes with whatever scheme its key and the peer agreed on, outside the list the provider verifies with. Keys now load through a provider that limits each key to the FIPS signature schemes and refuses a key that can sign none of them, such as Ed448; the volume server and the worker's gRPC TLS name the certificate and key files in that error. The lists follow Go 1.27.4, which go.mod now requires: its defaults_fips140.go allows ML-DSA-44, -65 and -87 as signature schemes and ML-DSA certificate keys (for Go's native module only), so they are allowed here as well. Go also allows MLKEM1024 but does not enable it by default, so it stays out of the key exchange list as in Go's defaults. "off" keeps the default key provider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: skip the truncate manifest test on freebsd like its fake filer 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> |
||
|
|
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> |
||
|
|
781288cf11 | s3api: ignore custom x- query parameters on bucket requests (#13046) | ||
|
|
eb655f46ba |
mount: merge a flush's folded chunks as the chunks, not as a new manifest (#13043)
* mount: merge a flush's folded chunks as the chunks, not as a new manifest A flush folds the handle's chunks into manifests before it commits, and installs the folded list in the handle. When the commit finds that a peer changed the entry, mergeContentEntry replays the handle's changes since its base onto the peer's entry: a chunk not in the base counts as the handle's own write, a base chunk missing from the handle as one it dropped. A manifest the flush just made of base chunks therefore goes in as a write of the handle's, with every chunk it holds: - after a peer rewrote the whole file (a bloat merge, stamped with the oldest data it holds) or dropped chunks, the manifest brings the old chunks back, and where their stamps are newer they hide the peer's bytes; - after a peer folded the same chunks, the entry holds both manifests. Since #12462 a flush folds every 256 small chunks, so two mounts that append to one file, as the ranks of a training job often do with its log, reach this. The flush now records what its fold packed (chunkFold). The merge sees the folded chunks instead of the new manifests, so the fold is no change at all; the merged entry goes out unfolded, and the next flush folds it again. When the commit fails, the fold is taken back out of the handle, whose base still has the chunks, so a later merge or flush does not take the manifests for writes either. Their blobs are left unreferenced, as a failed fold leaves them. * mount: rebase a merged flush onto the entry the filer stored Review follow-up. A merged commit sends the merged chunks unfolded, and the filer can fold them before it stores the entry (cleanupChunks). The flush installed the request in the handle, but took the stored entry as the handle's base (ackedBase), so the handle held flat chunks against a base that lists a manifest. A later merge, such as a peer's truncate reaching the dirty handle, would take those chunks for writes of the handle's and publish them again. The handle is now rebased onto the stored entry it takes as its base, in both flush paths. rebaseEntry still gets the request, so chunks attached after it was taken are kept. TestFlushMergeInstallsTheEntryTheFilerStored: a peer's chmod refuses the first commit, the merged retry sends 256 flat chunks, and a filer that folds them stores a manifest; the handle and its base must both hold the stored entry. It fails with the request installed. |
||
|
|
424c67ad06 |
mount: truncate a manifest the cut goes through as the chunks it holds (#13042)
* mount: truncate a manifest the cut goes through as the chunks it holds Truncating a file shortens every chunk the new size cuts through, a manifest chunk included. A manifest's span only says where its chunks lie: reads resolve the chunks inside it at their own offsets and sizes, so the bytes past the cut stay readable. Once the file grows over them again without writing them, by an extending truncate or a write past the end, they come back where zeros belong. Reproduced with weed mount on a local cluster: 700 lines appended with one close() each, so the small-chunk fold put the first 256 into a manifest; then a truncate to the first 100 lines and an ftruncate past the old end. The extended range read 8,580 bytes of the cut lines instead of zeros, through both mounts of the file. Since #12462 any file grown by a few hundred small appends has manifests; before it, only files of 10,000 chunks did. A truncate now opens each manifest the cut goes through, nested ones too, and cuts the chunks it holds. The manifest leaves the entry, and the filer deletes it with the chunks past the cut when the entry is stored. A manifest shortened by an earlier truncate first gives up the chunks past its own span. If a manifest cannot be read, the truncate fails with EIO and the file is left as it was. * mount: keep a truncate's expanded chunks from merges, read its manifests with a token Review follow-ups: - The chunks a truncate takes out of a manifest are not in the handle's base, which lists the manifest. A merge onto a peer's entry took them for writes of the handle's, so after a peer cut the file shorter and the filer queued the rest for deletion, the handle could publish references to those chunks again; the gap check passed because plain chunks covered the range. Before the expansion, the manifest across the cut refused that merge. A truncate that expands a manifest now marks the handle as having rewritten its chunks, so the merge is refused when the peer changed chunks, at the next flush and when the peer's event reaches the handle. - A truncate by path, with no open handle, read the manifest before its file id was registered for a filer-issued read token, so a mount reading with -volumeReadAuth sent the read without one and the truncate failed with EIO. The entry's chunks are registered under its path first. - All manifest reads of one truncate share one one-minute deadline, instead of a minute each. TestTruncateThroughManifestCutsItsChunks runs SetAttr with and without an open handle: it fails without the registration (no handle) and without the rewrite mark (open handle). TestMergeRefusesTruncateExpansionOverPeerTruncate shows the merge that published a peer-dropped chunk, and its refusal. * mount: answer a truncate interrupted while reading a manifest with EINTR 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> |
||
|
|
be8eb02ac0 |
util: remove multipart temp files parsed on the idle-timeout pause's request copy (#13044)
* util: remove multipart temp files parsed on the paused request copy net/http removes the temporary files of a multipart form parsed on the Request it passed to the handler. PauseIdleTimeoutWhileHandling hands the handler a shallow copy when the request has a body, so a form parsed there (ParseMultipartForm, or FormValue on a multipart body) left its temporary files behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: test that the idle-timeout pause removes multipart temp files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: point the multipart temp-file test's temp dir at Windows' TMP and TEMP too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f2e9e49842 |
master: stop volume growth from leaking volumes into a just-deleted collection (#13035)
* topology: stop a grow once a delete fences its collection A grow request creates its volumes one after another and resolves the collection by name for each, so once the collection was deleted the rest of the request recreated it. The request now keeps the collection it started in and holds a per-collection fence shared while it creates each volume. A delete can raise the fence exclusively, which waits out the volume in flight, and the request stops at its next volume. A collection dropped only because its last layout emptied is followed to the one published under its name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: fence volume growth before deleting a collection The delete listed the collection's servers, fanned out DeleteCollection, and only then dropped the collection from the topology. A grow still running created its next volumes during or after the fan-out, on servers that had already been cleaned or were not in the list, and those volumes registered a new layout for the deleted collection that nothing removed. A bucket deleted right after its first write leaked most of its initial volumes this way. The delete now raises the collection's growth fence first, so the volume in flight registers and is deleted with the rest, and the grow stops. A failed fan-out lifts the fence, since the collection stays in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: refuse assigns from a collection being deleted The delete waits for the volume a grow is creating before it lists the collection's servers, and the collection's writable volumes stayed assignable meanwhile, so a write could land in a volume about to be deleted. The delete now raises the fence before it waits, and assigns check it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: list only collections that hold a volume layout A grow request publishes its collection before its first volume registers, so one that created nothing left a collection with no volume in the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: queue no grow for a collection being deleted PickForWrite returned the layout's shouldGrow before it checked the fence, so an assign on an empty layout of a collection being deleted still queued a grow. That grow could run after the delete finished and recreate the collection. Check the fence right after the pick, before any early return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: keep an emptied collection published while growth holds it DeleteLayout unpublished a collection as soon as its last layout emptied, even while a grow held it or a delete had fenced it. The volume in flight then registered by name into a new collection that the delete never listed servers for, and the delete's final DeleteCollection dropped it from the topology while it stayed on disk. Unpublish an empty collection only when no grow or delete holds it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: fence the collection still published under the name An emptied-layout cleanup that passed its fence check could unpublish the collection while the delete waited to fence it. The delete then fenced and listed an orphaned object, while growth published a new collection under the name that no fence held. Topology.FenceGrowth re-checks publication once the fence is up and moves to the collection published since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: run one delete of a collection at a time Two deletes of one collection both fenced it and fanned out by name. Once the first removed it, a write could recreate the collection, and the second delete removed the new one's volumes and topology entry. FenceGrowth now waits for a delete already running on the collection and finds nothing once that delete removed it; a delete that failed hands the collection to the one waiting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: stop a delete another delete beat to the collection A delete that fenced the collection but had not yet checked that it was still published retried when it was not, for the collection an emptied layout drops. A delete that removed it in between also left it unpublished, so the retry fenced and returned the collection a write had recreated under the name since. finish(true) now marks the collection deleted before it unpublishes it, and the retry stops at that mark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: keep the name fenced through the EC pass of a delete The normal pass unpublished the collection and let growth back in before the EC pass ran. The EC pass deletes by name on every server holding the collection's shards, and DeleteCollection on a server also drops its normal volumes, so a write recreating the bucket in between could land a volume that the EC pass then deleted. A second delete of the name, finding no collection, also ran its own EC pass by name. deleteCollection now fences the name once, before either pass, and lifts or ends the fence after both. finish(true) unpublishes the collection then. A name with EC shards only gets an empty collection to fence, so an assign under it is refused too, and a delete that finds nothing skips both passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: wait for the second delete's lock instead of sleeping The overlapping-delete tests slept before acting on the first delete. A second delete scheduled late started after the collection was replaced, or after the first delete was already over, so the tests could fail or pass without the overlap they check. They now wait until the second delete is blocked on the delete lock, read from the goroutine stacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * topology: empty the layout through UnRegisterVolumeLayout in the test The test called DeleteLayout, whose signature differs in builds that key layouts by more than replication, TTL and disk type. UnRegisterVolumeLayout reaches the same cleanup from a VolumeInfo and has one signature everywhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8053e77813 |
s3api: decide existing-object-tag denies on the object's tags (#13038)
* s3api: report a bucket policy Deny on existing object tags HasExistingObjectTagDeny tells whether a bucket policy has a Deny statement conditioned on s3:ExistingObjectTag/<key>, so the auth layer knows when a deny may turn on tags it has not read yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: decide existing-object-tag denies on the object's tags The auth layer evaluates the bucket policy before the handler reads the object, so s3:ExistingObjectTag/<key> resolves to a missing tag. A Deny with a negated condition (StringNotEquals, StringNotLike, StringNotEqualsIgnoreCase, Null true) then matched every object and was final, even one whose tag satisfies it, as in the deny-until-scanned-clean pattern. When that early evaluation denies and the policy has such a Deny, look up the object's entry and evaluate again with its tags. A missing object or a failed lookup keeps the deny. Copy sources and per-key checks that go through authorizeObjectKeyAction get the same treatment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: give identity checks the object tags a Deny was decided on With IAM integration, VerifyActionPermission evaluates the mirrored bucket policy again alongside the identity's policies, from a condition context built from the request alone. The negated existing-tag Deny matched there once more and denied an object tagged to pass it. evaluateBucketPolicy now returns the request carrying the tags it read, and RequestConditionValues reports them as s3:ExistingObjectTag/<key>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: recheck in-flight tag conditions on the version served An in-flight request is authorized again when access changes. The entry lookup read the version current by then, so a newer version tagged to pass the Deny could keep a download of an older, denied version running. The handler's entry recheck now records the entry it authorized on the tracked request, and the re-check decides on that entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: load the bucket before deciding an object request on its policy On a bucket whose policy was not loaded yet, the early bucket policy check found no policy and skipped the object-tag lookup, so the identity checks saw the request without the object's tags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: keep an owned copy of the entry a tracked request served Handlers change the entry's metadata after the check, for example when storing new tags, so revalidation read a map the handler was writing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
aaca5c8c0a |
s3: verify SigV4 header values with each SDK's Trimall (Go, Java, botocore) (#13036)
* s3: trim only ASCII spaces in SigV4 canonical header values
signV4TrimAll used strings.Fields, which also splits on Unicode spaces
(U+00A0, U+202F, ...). A signed header whose value holds one inside, such
as an x-amz-meta-* filename from a macOS screenshot ("... at 2.20.09 PM"),
got a different canonical request than the client signed, and the request
failed with SignatureDoesNotMatch. Trim and compress only ' ', as the AWS
SDKs do (aws-sdk-go-v2's v4.StripExcessSpaces).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: verify SigV4 with both clients' Trimall for non-ASCII-space whitespace
The AWS SDK for Go v2 collapses only ASCII spaces in a signed header value and
trims the edges with strings.TrimSpace; botocore turns every whitespace
character into a space. Match the Go SDK first (now also trimming Unicode
whitespace at the edges) and, when it gives a different canonical request,
retry with the previous strings.Fields form so botocore signatures keep
verifying.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: pass the header value trim to getCanonicalRequest and getCanonicalHeaders
Fold canonicalRequestWith and canonicalHeadersWith into the existing
functions instead of keeping them as wrappers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: also verify SigV4 header values with the AWS SDK for Java Trimall
The Java SDKs collapse runs of spaces and tabs but keep Unicode spaces, so
a value with both a tab and a U+00A0/U+202F matched neither the Go SDK nor
the botocore form. It is tried between the two, so a value with only one
kind of whitespace still computes at most two signatures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Bear1110 <14165451+Bear1110@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
|
||
|
|
e743f99bb5 |
util: keep a request's context while its handler works quietly past the idle timeout (#13040)
* util: keep a request's context while its handler works quietly past the idle timeout A request that the server works on for longer than the listener's idle timeout, without reading or writing, lets that timeout end net/http's background read: the read the server keeps waiting while a handler runs, to see a client hang up. net/http takes the failed read for the client's connection failing and cancels the connection's context, so the request in progress, and every later request on the kept-alive connection, run with a canceled context. #10212 covered a long write-only response, whose writes now extend the read deadline; an answer that has not started yet has nothing to extend it. On the S3 gateway (-idleTimeout 120 s) such requests are the ones that answer only when their work is done, e.g. a large CopyObject into a versioned bucket, which the copy keep-alive of #12862 does not cover. After one, the next requests on that connection fail within a millisecond: a ListObjectsV2 answers 500, a GetObject and a PutObject 499 ClientDisconnected while the client is still connected. The filer's HTTP listener has a 10 s idle timeout by default. PauseIdleTimeoutWhileHandling, which newHttpServer now installs next to the ConnContext hook it already sets (S3, filer, IAM and master HTTP), takes reading out of the activity timeout from the moment a request's body has been read to its end (at once when it has none) until its handler returns: the client is waiting for the answer, so a connection that carries nothing means the server is at work. Reading a body, writing an answer and waiting for the next request stay under the timeout, and a client that closes its connection still cancels the context. Over HTTP/2 the frame reader keeps no deadline while such a handler runs and gets it back when the last one returns. Tests: weed/util/net_timeout_test.go (a quiet handler over HTTP/1.1, TLS and HTTP/2, and the next request on the same connection; the same after a 1 MiB body; a stalled body, an idle connection, an idle HTTP/2 connection and a client hang-up still end as before; concurrent requests; a waiting read held by the pause and released at its end; the context loss without the wrapper) and weed/command/server_http_test.go (newHttpServer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webdav: serve through newHttpServer so quiet handlers keep their context weed webdav serves a util.Listener with an idle timeout (10 s by default) but built a bare http.Server, so it had neither ConnContext nor the idle timeout pause. A COPY or MOVE of a large file answers only once it is done, and like the S3 and filer handlers it then lost its context, and so did every later request on the connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: pause the idle timeout for HTTP/1.x requests only HTTP/2 has no background read to protect: when its connection carries nothing for the timeout, the frame reader's deadline closes the connection, and no later request runs on it. That deadline is also what ends a stream whose client stopped reading, since the answer waits for flow-control credit, not on the socket, where the write deadline would end it. With the pause on HTTP/2 requests, a download whose client stopped reading held its handler and connection until the client acted, and a stream that declared content-length 0 but never ended could hold its handler the same way. Pause only HTTP/1.x requests; HTTP/2 keeps the timeout it had. Tests: TestStalledDownloadStillTimesOut over HTTP/1.1, TLS and HTTP/2 (the HTTP/2 case was still waiting after 8 s with the pause on HTTP/2) and TestOnlyHTTP1RequestsArePaused; the HTTP/2 quiet-handler cases are gone, with them the HTTP/2 subtest that flaked under -race. TestPauseUnderConcurrentRequests gets a 1 s idle timeout, so that a request waiting for its turn on a slow run does not find its connection closed. 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> |
||
|
|
1f8ad7016f |
filer: compare garbage chunks by needle identity (#12992)
* Normalize chunk identities during garbage comparison * Keep replication chunk respellings observable * filer: skip the needle identity index when nothing is subtracted Every compaction subtracted its retained chunks from an often empty covered list, parsing and re-formatting each retained file ID first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: skip the identity subtraction at the compaction call site Returning early from doMinusChunks on an empty minuend stopped MinusChunks from calling GetFileIdString on the new entry's chunks. After CreateEntry of a new file, the caller's chunks then kept the FileId that BeforeEntrySerialization cleared, so tus completion built its still-referenced set from empty IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: match needle spellings through DoMinusChunks instead of a new function Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: DoMinusChunks always matches chunks by needle Drop the byNeedle parameter so DoMinusChunks keeps its two-argument signature and every caller, including ones added on master since, compares equivalent file ID spellings as the same needle. The needle normalization moves from the server scope checks to filer.ChunkIdentity so both share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filersink: match replicated source file IDs by needle compareChunks no longer reports a respelled source chunk, so the replica keeps the SourceFileId it was copied under. Removing chunks the source dropped and judging stale backup chunks now compare that ID by needle, otherwise a later removal in the other spelling would leave the replica's chunk behind. 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> |
||
|
|
f927436567 | docs: regenerate star history chart | ||
|
|
68e99fe04d |
build(deps): bump github.com/ydb-platform/ydb-go-sdk/v3 from 3.155.1 to 3.157.1 (#12925)
build(deps): bump github.com/ydb-platform/ydb-go-sdk/v3 Bumps [github.com/ydb-platform/ydb-go-sdk/v3](https://github.com/ydb-platform/ydb-go-sdk) from 3.155.1 to 3.157.1. - [Release notes](https://github.com/ydb-platform/ydb-go-sdk/releases) - [Changelog](https://github.com/ydb-platform/ydb-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/ydb-platform/ydb-go-sdk/compare/v3.155.1...v3.157.1) --- updated-dependencies: - dependency-name: github.com/ydb-platform/ydb-go-sdk/v3 dependency-version: 3.157.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
39675b2faf |
filer: hide remote rename source paths from scoped responses (#13010)
* filer: redact remote rename source from scoped responses * Preserve scoped remote rename markers * Consolidate scoped marker replacement coverage * Refuse scoped whole-entry guards during remote rename * Keep coded create refusals for guarded scoped writes * Make scoped subscription batch coverage deterministic * filer: refuse scoped conditions that compare the remote rename source IF_EXTENDED_NOT_EQUAL clauses and ExpectedExtended on Create, Update and DeleteEntry could still compare a guess against the hidden marker, so a scoped client could confirm the source path it redacts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: refuse scoped condition gates on the remote rename source An IF_EXTENDED_TIME_ELAPSED gate applies its time check only when the gate value matches, so a gate on the marker also confirms a guess. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a pending rename source out of remote copy errors A failed copy of a pending remote-only rename named the marker's source location, which the backend error repeats, and rename RPCs return that error to scoped callers. Log the full error and return one naming only the paths the caller supplied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: let a scoped local overwrite end a pending remote rename Scoped replacements kept the hidden rename source marker even though a scoped entry can never stay remote-only, so the marker was stale on the local copy and every later scoped IF_ENTRY_EQUAL write was refused. Drop the preservation and let the overwrite clear the marker as other local writes do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * codespell: ignore poligon only inside URLs 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> |
||
|
|
0fb1387226 |
s3: compare If-None-Match weakly, as the filer and volume servers do (#13033)
* s3: compare If-None-Match weakly, as the filer and volume servers do The S3 gateway matched conditional ETags by trimming quotes, so a weak tag such as W/"etag" in If-None-Match never matched and a revalidating GET got 200 instead of 304. Move the filer's RFC 9110 matcher to weed/util and use it in the gateway: weak comparison for If-None-Match, strong for If-Match. The routed write condition now sets AllowWeak on IF_ETAG_NOT_MATCH so the check under the object lock agrees with the gateway's pre-check. * s3: split write-condition ETag lists the way the gateway matches them etagList split on every comma and kept empty elements, so the filer's locked If-None-Match check (now a weak comparison) could match a fragment of one quoted tag, or an empty element, that the gateway's pre-check ignores. A PUT with If-None-Match: W/"<etag>,x" passed the pre-check and then got 412 under the lock. Reuse the gateway's quote-aware splitter and drop empty elements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Mansur Akhmadi <10739460+mansur-akhmadi@users.noreply.github.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7738ea7f45 |
s3: keep a bucket policy change from aborting its own request (#13034)
* s3: keep a bucket policy change from aborting its own request The bucket metadata event re-checks every request in flight on the bucket, including the PutBucketPolicy, DeleteBucketPolicy or DeleteBucket request that made the change while it is still answering. A deny-all policy, or the removal of the policy that granted the requester access, then closed that request's connection after the change was stored; the client saw a reset and its retry was denied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: keep re-checking a policy change until it stores it Exempting the policy-changing actions at admission let a request whose key was revoked while it read its body still replace or delete the policy. The request stays tracked now and untracks itself right before it stores its change; if it was aborted by then, it stores nothing. DeleteBucket untracks itself before the delete, which also covers the identity re-check its bucket-scoped action pruning triggers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
01b88ad2f9 |
build(deps): bump go.etcd.io/etcd/client/pkg/v3 from 3.7.3 to 3.7.4 (#12927)
Bumps [go.etcd.io/etcd/client/pkg/v3](https://github.com/etcd-io/etcd) from 3.7.3 to 3.7.4. - [Release notes](https://github.com/etcd-io/etcd/releases) - [Commits](https://github.com/etcd-io/etcd/compare/v3.7.3...v3.7.4) --- updated-dependencies: - dependency-name: go.etcd.io/etcd/client/pkg/v3 dependency-version: 3.7.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> |
||
|
|
b42a5ca24e |
build(deps): bump github.com/rabbitmq/amqp091-go from 1.16.0 to 1.17.0 (#12928)
Bumps [github.com/rabbitmq/amqp091-go](https://github.com/rabbitmq/amqp091-go) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/rabbitmq/amqp091-go/releases) - [Changelog](https://github.com/rabbitmq/amqp091-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/rabbitmq/amqp091-go/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/rabbitmq/amqp091-go dependency-version: 1.17.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
5be58fccd7 |
build(deps): bump github.com/apache/arrow-go/v18 from 18.8.0 to 18.9.0 (#12926)
Bumps [github.com/apache/arrow-go/v18](https://github.com/apache/arrow-go) from 18.8.0 to 18.9.0. - [Release notes](https://github.com/apache/arrow-go/releases) - [Commits](https://github.com/apache/arrow-go/compare/v18.8.0...v18.9.0) --- updated-dependencies: - dependency-name: github.com/apache/arrow-go/v18 dependency-version: 18.9.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
8d975574d4 |
docker: let the caller's GODEBUG fips140 setting override the entrypoint's default (#13026)
docker: let the caller's GODEBUG fips140 setting override the default entrypoint.sh appended fips140=on after the caller's GODEBUG, and Go applies the last of repeated settings, so `docker run -e GODEBUG=fips140=only` ran with fips140=on, and fips140=off stayed on. The default now goes first. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
c2c5aac943 |
test: fall back to a Maven Central mirror for the Spark Lance connector (#13031)
spark-submit resolved the Lance bundle and its dependencies through Ivy from Maven Central only, so a refused Central request failed the run in seconds with "module not found". --repositories adds the Google mirror after Central in Ivy's resolver chain. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9c17e0038d |
volume(rs): sign a fresh write JWT for each replica forward (#13030)
* volume(rs): sign a fresh write JWT for each replica forward The primary checks the write JWT when the request arrives, then reads the body. A body slower than the JWT lifetime (10 s by default) left the forwarded Authorization header expired, so replicas answered "wrong jwt" and the write failed with 500. With a write signing key, each forward now carries a JWT signed right before it, after the replica lookup, for the base file id the request was authorized for. A raw jwt= query field, which the replica reads before the header, is no longer forwarded on writes. Without a signing key the incoming Authorization header passes through as before. Deletes are unchanged. Mirrors the Go volume server change in #13028. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): take the replica forward key from the write auth snapshot The replica JWT key was read from the guard again after the body was read, so a reload that enabled write signing in between could sign replica forwards for an upload that was never authenticated. Read it in the same guard snapshot as the write's JWT check, as Go's PostHandler does with writeSigningKey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): drop jwt query fields by decoded name on write forwards Go's GetJwt decodes query names and reads jwt before the Authorization header, so a forwarded %6Awt=x would still override the fresh JWT on a Go replica. Drop every field whose decoded name is jwt from a write forward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a409877b8f |
volume, operation: refresh the write JWT for replica forwards and filer-proxy retries (#13028)
* volume, operation: refresh the write JWT for replica forwards and filer-proxy retries A write JWT is checked when a request arrives, but a slow chunk can take longer to stream in than the JWT lives. The volume server then forwarded the already expired JWT to its replicas, which rejected it with wrong jwt, and the client retried through the filer with its own filer JWT, which by then had expired too. Only a 401 marked as an expired volume JWT re-minted the filer JWT, so the 500 from the failed replica forward led to retries that could never succeed. The volume server holds the signing key and has already authorized the request for this file ID, so it signs a fresh JWT for the forward; without a signing key it forwards the incoming one as before. A filer-proxy upload re-mints its filer JWT before every retry, whatever the previous failure was. Refs #6220 * volume: mint the replica forward JWT right before each forward A JWT minted before the uncached master lookup spends part of its lifetime on that lookup, so the replica can still see it expire; minting inside the forward path gives each replica request its full lifetime. Minting stays unconditional rather than forwarding a still-valid incoming JWT, which could expire in flight and reintroduce the failure. The cost is a key rotation constraint: a new write signing key must be verify-only on every volume server before any server makes it current. The base file ID trim moves into one helper so the authorization check, the expiry classification and the mint cannot disagree on which file ID a write JWT covers. |
||
|
|
d0661afad8 |
mount: refuse SSE-KMS and SSE-C objects the native read path cannot decrypt (#13027)
* mount: refuse SSE-KMS and SSE-C objects the native read path cannot decrypt The native read check only recognized SSE-S3, so objects the S3 gateway stored with SSE-KMS or SSE-C were read chunk by chunk and the mount returned their ciphertext with success. Detect every S3 server-side encryption type, from the object metadata or any chunk, and answer open, read and copy_file_range with ENOTSUP unless the object is SSE-S3 and -sseS3Read routes it through a gateway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drop S3 encryption markers when a file is truncated to zero A full truncate removes the encrypted payload, but the object metadata still named SSE-C, SSE-KMS or SSE-S3, so the plaintext the mount wrote afterwards was refused on read. Clear those markers in SetAttr and truncateEntry when the size becomes zero, and reset the handle's cached classification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
35caf2542c |
operation: report a delete result for volumes the lookup cannot locate (#12488)
* weed/filer: retry deletes when volume replicas are offline or missing Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com> * operation: assert one delete result per file id in the no-location test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
77a6787335 |
Bound upload memory: admission by size, gateway holder writes, 503/SlowDown back-pressure, body deadline (#13021)
* util: one admission rule for upload limits * operation: mark gateway fan-out holder writes as client traffic * volume: bound upload admission, limit gateway holder writes, 503 on timeout * volume: charge unknown-length uploads half the budget, document client wait cap * s3, filer: admit uploads by inFlight+size and charge unknown lengths a chunk * s3: answer a volume overload as SlowDown with Retry-After * operation: cut an upload whose body crawls below the minimum rate on any host * operation: make the slow-commit deadline test honour the request context * s3: stop chunk uploads when the client goes away * operation: treat a body deadline cut as back-pressure, not a same-holder retry A body that crawls past the body deadline returns from retriedUploadData at once, like an overload, and counts toward the single reassign the chunk loop and the filer retry gate give back-pressure. A watchdog cut keeps its retry on a fresh conn. Both still match ErrUploadStalled and stay reassignable. * operation: apply the body deadline only to uploads that opt in UploadOption.BodyDeadline and ChunkedUploadOption.BodyDeadline turn the body deadline on; S3 chunk uploads (relay and fan-out) and the filer's chunk loop set it. Mount, filer.sync, filer.copy and UploadWithRetry keep the stall watchdog only, as before the deadline existed. * s3, operation: check a chunk cancelled with its client is deleted from every holder A volume commits on a context that ignores the cancel, so a chunk whose caller went away after sending the body may still land. The chunk loop already deletes the fid from every holder after a failed attempt; pin that for the relay and fan-out paths and for an S3 PUT whose client goes away. * s3: count a request's declared bytes in the circuit breaker byte limits The per-bucket and global byte counters go back to the declared length (an unknown length counts one chunk), so a bucket bytes limit still rejects a single PUT larger than it. Only the upload budget uses the capped gateway charge. * s3: answer copy chunk overloads as SlowDown, tidy the client-gone checks CopyObject and UploadPartCopy map a volume overload or an exhausted stall to SlowDown, as PutObject does. The client-gone log check matches the mapper's context.Canceled test, the truncated-body case drops a check the first case already makes, and the Retry-After test reads the headers actually sent. * filer, volume: clamp the filer charge chunk, set the upload gauge under the lock A filer with -maxMB 0 charges its default chunk size instead of nothing. The volume server sets its in-flight upload gauge inside the critical section. The upload limit tests wait until the waiter is parked before releasing, check handleUploadRequest gives its charge back, and use CI-safe bounds. * volume: cap the Rust server's client upload-slot wait at 5s Same cap as the Go volume server's volumeClientUploadWaitCap, so a gateway's body deadline never fires before the 503. * operation: reflow the body deadline comment * volume(rs): count a gateway's src=client holder write against the upload limit Mirrors operation.IsReplicaForward: only a primary-to-replica forward skips the upload budget; a gateway's ?type=replicate&src=client fan-out waits like any client write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): admit uploads by inFlight+size, reserved atomically Mirrors the Go volume server's waitForUploadSlot: an upload is admitted by util.UploadAdmits (idle server, or inFlight + size within the limit) and reserves its bytes in the same step, so concurrent waiters cannot all pass one check. Primary-to-replica forwards and unlimited servers are counted but never refused. UploadLimitCond counts once per waiting upload, and the wake-up is armed before each check so a release in between is not missed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): charge an unknown-length upload against the upload limit Mirrors the Go volume server's uploadCharge: a chunked upload without Content-Length reserves one file's worth of budget, at most half the limit and at least 1 byte, instead of 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): a zero -inflightUploadDataTimeout waits the 5s client cap The Go volume server now reads 0 as the 5s cap (its flag help says so); the Rust server used a 2s wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): close a rejected large or unknown-length HTTP/1 upload Mirrors the Go volume server's uploadRejectCloseThreshold: the 503 for a body over 256 KiB, or one without a length, carries Connection: close instead of keeping the connection for a body nobody reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): drop src from a primary's replica forward A client upload carrying src=client kept it on the forward, so replicas treated the forward as gateway fan-out and could refuse it after the primary had already appended. Go's ReplicatedWrite builds a fresh query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): keep the upload admission CAS buildable on rust 1.91.1 Atomic try_update is stable only since 1.95. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): refuse an upload the in-flight counter cannot hold A replica forward added its charge with fetch_add, so a Content-Length near i64::MAX wrapped the shared counter negative and let later client uploads past admission. The forward now reserves with a checked add and answers 503 when the size does not fit; the client CAS adds only after admission passes. With no upload limit the counter only feeds the gauge, so it keeps wrapping arithmetic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: refuse an upload the in-flight counter cannot hold A replica forward added its charge unchecked, so a Content-Length near math.MaxInt64 wrapped inFlightUploadDataSize negative and let later client uploads past admission. Under the lock the reservation now checks that the counter can hold the charge and answers 503 otherwise, matching the Rust volume server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: keep the request body on a rejected upload Replacing r.Body with http.NoBody hid the server's early close of the unread body from net/http before Go 1.27, so it skipped the FIN-then-wait close and reset the connection under a client still sending. Go 1.26.6, the version go.mod declares, then failed TestUploadLimit503ReachesGoClientForLargeBody with a write error instead of the 503. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: compare upload admission without forming inFlight+size * operation: reassign a chunk after a 429 as after a 503 * s3: do not count a chunk assignment the client cancelled as a filer failure * filer: charge an upload by its request chunk size, and an inline upload by its whole body * s3: hold an aws-chunked body to its X-Amz-Decoded-Content-Length * volume: answer a rejected small-body upload without waiting for its body * s3: fill the upload budget before testing that a release wakes every waiter --------- Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
41f1c25d01 |
s3api: drop bucket size gauges on an instance that lost the metrics lock (#13019)
* s3api: drop bucket size gauges on an instance that lost the metrics lock Only the S3 instance holding the s3.leader lock collects bucket sizes and quota state, once a minute. An instance that loses the lock and keeps running never clears what it set. bucketMetricTTLControl drops a bucket's gauges only after 10 minutes without activity, and every request the instance serves for the bucket counts as activity. So for the buckets clients keep using through it, its bucket_size_bytes, bucket_physical_size_bytes, bucket_object_count, bucket_quota_bytes and bucket_read_only series stay at the values it collected last, next to the new holder's current ones. Summing a gauge over instances counts those buckets twice, and taking the max shows a bucket that has shrunk since at its old size. On every tick without the lock, reset these five gauges. Only the holder's collection sets them, so an instance that never held the lock loses nothing, and one that lost it stops reporting within a minute. In a cluster with seven S3 instances, one kept 10 to 14 buckets at their old values for four days after losing the lock; at one point the max over instances put a bucket 37 TB above its size. TestBucketSizeMetricsTickWithoutLockDropsGauges sets the gauges for two buckets, checks that a tick with the lock leaves them, and that a tick without it removes all five. Without the reset it fails for each gauge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: shorten the bucket size metrics lock-loss comments 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> |
||
|
|
d2276f531e |
master: apply the whitelist to management gRPC RPCs (#13022)
* master: gate operator-only management RPCs on the whitelist CollectionDelete, DisableVacuum, EnableVacuum, VolumeGrow, ResumeVolumeGrowth, LeaseAdminToken and ReleaseAdminToken now call checkGrpcAdminAuth, matching the whitelist their HTTP counterparts already enforce. VolumeGrow stays open to the in-process growth loop, and callers on the local gRPC socket of weed server/mini are local. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: admit unknown masters over KeepConnected only from the whitelist A KeepConnected registration as a master pulls that address into the raft quorum. Accept it from any caller only for this master and its -peers; any other master address now needs a whitelisted caller, the same check RaftAddServer applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: test that every RPC is gated or listed with a reason Port the volume server's coverage test so a new master RPC cannot skip checkGrpcAdminAuth without an explicit exemption. The proto and AST helpers now take the proto file and receiver name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: admit callers on the local gRPC socket weed server and weed mini route same-host gRPC dials through a unix socket, whose peer address carries no IP. With -whiteList set the volume server refused the in-process master's AllocateVolume, so no volume could be grown. The Rust volume server serves gRPC over TCP only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: match a KeepConnected master against configured peers by gRPC endpoint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * pb: bind the local gRPC socket for the owner only Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: warn when a deleted bucket's collection is left on the master Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * pb: bind the local gRPC socket in a private directory before moving it into place Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: report an unconfirmed bucket collection delete as such Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a00dbff13b |
sftp: apply the bucket's default Object Lock retention to uploads (#13017)
* s3_objectlock: read a bucket's default retention from its entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: give uploads into an Object Lock bucket its default retention Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: match uploads against the cleaned buckets folder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
87ee3c57cb |
s3: keep the EOF read out of the timed body in the put stage test (#13016)
* s3: do not delay the EOF read in the put stage timing test TestPutStagesRecordEachStage checks that the storage stage is at least 5ms. That stage is the second chunk's assign wait (20ms) minus the final read that only returns EOF, which slowReader also delayed by 10ms. When busy goroutines hold every P, the reader's wakeup can lag the assign's by as much as a preemption slice, and storage drops below the floor. slowReader now delays only reads that return data, so the EOF read is instant and storage covers the whole assign wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: keep the EOF read out of the timed body in the put stage test Skipping the delay on the EOF read still left that read inside timedBody, so a stall there was subtracted from storage. Feed the upload through an eight-byte limit instead: the final EOF comes from the limit reader without reaching the timed body, so storage always covers the second chunk's full assign wait. slowReader goes back to delaying every read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
dcce121d95 |
weed fix.recover: recover needles past damaged .dat regions (#13002)
* feat: weed fix -verify to resync past damaged regions in .dat Plain `weed fix` walks .dat by trusting each needle header, so a damaged region in the middle loses or misindexes everything after it, and a torn or garbage tail ends up in the index and keeps the volume read-only. -verify reads every needle, checks structure and CRC32, and on a failure searches forward at needle alignment for the next verifiable needle. Each skipped region is reported as zero-fill / garbage / garbage+zeros with its length, zero windows and the fid of the needle that was hit. The index is rebuilt from verified needles only (old one kept as .idx.bak); -truncateTail cuts trailing garbage so the load-time integrity check passes, -dryRun only reports. Works with the 5BytesOffset build. * feat: add weed fix.verify, a read-only check of .dat files Runs the same needle/CRC verification and resync scan as `weed fix -verify` but never writes: no .idx rebuild, no truncation. Takes folders and/or .dat files, filters with -collection / -volumeId, prints the damaged regions (optionally to -report) and exits 0 when clean, 3 when damage was found and 1 when a file could not be verified. The scan options are shared with `weed fix -verify`. * feat: weed fix -compact, verify and compact a damaged volume in one pass -compact implies -verify. While the .dat is scanned, every verified needle gets an index entry, and from the first damaged region in the middle of the file the needle bytes are streamed into a new .cpd as well (the intact prefix before it is copied as one block). The result is a .dat without the damaged regions and an append-ordered .idx that matches it exactly, so a full volume scrub no longer complains about the .dat size. The compaction revision is bumped like a vacuum does. A volume without damage is left untouched, and damage only at the tail is just cut off in place, so neither costs a .dat copy. The old .idx is kept as .idx.bak and the old .dat as .dat.bak (-deleteOriginal removes it). The free space needed for the new .dat is checked before anything is written, a failing swap is rolled back, and progress is printed every 30s. * refactor: reuse backend, super block and throttler code in weed fix -compact - create the .cpd with backend.CreateVolumeFile and preallocate the bound of the new .dat; the result is truncated to its real length at the end - read the super block with super_block.ReadSuperBlock (also in the verifier) and write the bumped compaction revision with SuperBlock.Bytes() - throttle the .dat writes with util.WriteThrottler (-compactionMBps) - fsync the directory before and after swapping the new files in ReadSuperBlock cannot read a super block with extra data, so such volumes are rejected with its error instead of being handled by a hand-written parser. * refactor: drop helpers that duplicate existing code in weed fix -compact / fix.verify - util.FsyncDir instead of a local fsyncDir - io.NewOffsetWriter instead of a hand-written WriterAt adapter; the throttle now sits in one small writer wrapper used for both the prefix copy (via io.CopyBuffer) and the streamed needles, replacing the manual copy loop - needle.NewVolumeId instead of strconv for volume ids parsed from file names * fix: resync in weed fix -verify must not accept payload-less look-alikes After damage, a few bytes of a needle's tail followed by the next record's header could parse as a payload-less needle and be confirmed only because the file ended right after it, so a made-up key got into the index and swallowed the real delete record behind it. A payload-less candidate is now accepted without a verifiable successor only if it is a size-0 tombstone ending exactly at the end of the file (or, with a set timestamp, leaving less than a header); a set but implausible v3 timestamp rejects it. Anything else needs the next needle to verify. * test: recovery integration tests for damaged .dat heads (#5674, #12914) - zero-filled head (aligned and cut next record): all survivors indexed, region reported as zero-fill, trailing tombstone kept - plain weed fix stops at the first bad header (#12914 item 1) while -verify recovers the needles behind it - a needle rewritten after a damaged region is indexed at its newest copy - a zeroed superblock fails with an explicit unsupported-version error and fix.verify counts it as not verifiable (exit 1) - v1/v2 needle layouts verify cleanly * fix: reject a super block extra in fix -verify A super block extra describes an erasure-coded layout; the .dat behind it was re-striped into .ecXX shards and is not a plain needle file. Scanning it as one silently produced damage reports instead of telling the operator the file is out of scope. Return an explicit error instead. * fix: guard fix -verify/-compact against pending compaction commits and -dir.idx - refuse to start while a .cpc marker exists: an interrupted vacuum commit is pending and the volume server must reconcile it first (roll forward/back); writing a rebuilt .idx or new .cpd/.cpx over that decision would race it - clear a stale .cpc after a completed swap so it can never be rolled forward later (defensive; the start guard already refuses this state) - spell out in the help and print after a rebuild that the index is written next to the .dat: with a separate -dir.idx directory the .idx must be moved there and any stale .ldb dropped - tests: refusal leaves the marker and writes no .idx; a completed swap clears a marker that slipped past the guard * refactor: narrow this change to weed fix -verify Drop weed fix.verify and weed fix -compact from this change; they follow in their own pull requests. -report, -windowMB and -zeroWindow go with them: the scan uses fixed windows and prints its report to stdout. * fix: weed fix -verify: address review findings - -maxNeedleSizeMB limits only guesses made while resynchronising; a record reached at a known boundary may be as large as the file allows - a v2/v3 record whose parsed fields do not add up to its size, or a live record without data, is damage: a zero fill over the data length used to pass as an empty file because the CRC is only checked when there is data - a stamped v3 delete record found after damage stands on its own when its time is believable, not older than the last verified record and followed by zero padding, so a delete before a damaged tail is not lost - a read error while searching for the next needle fails the run instead of ending the scan and treating the rest as a garbage tail - keys whose newest record is damaged while an older copy is indexed are reported as stale-version warnings - the rebuilt index is staged as .idx.tmp and swapped in when complete; a stale .ldb next to it is removed so the volume server rebuilds it - -ignoreError reports a volume that cannot be verified and goes on - -truncateTail does not cut a tail it could not read and removes a partial tail backup - volume ids are parsed as uint32 - the test fixture stamps every record the way the volume server does * fix: weed fix -verify: prove deletes found after damage, swap the index safely - a delete record found while resynchronising must prove itself: a v3 one needs a believable time not older than the last verified record and zero padding (every v3 writer stamps deletes); a v1/v2 one needs the following records to reach data that passes its CRC, or the exact end of the file. Stray bytes in a zero-filled region used to pass as deletes of live keys. - the rebuilt index is fsynced before the swap, the previous one is kept as a hard link, and the new one replaces it in one rename, so a live .idx exists at every moment - .sdx and .rdb caches are removed with the .ldb - -verify exits non-zero when it found damage, like plain fix and -verifyCrc - with -ignoreError a file name whose volume id does not fit uint32 is reported and the batch goes on - the help and the printed hint say that a volume server prefers an .idx next to the .dat over the one in -dir.idx * fix: reject weed fix flag combinations -verify cannot honour -verify -remoteFile skipped an explicit .dat and reported success, -dryRun and -truncateTail were silently ignored without -verify, and -dryRun -ecx still rebuilt EC indexes. Check the combinations before any file is touched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: apply -volumeId before rejecting an out-of-range volume file name With -volumeId set, an unrelated file such as 4294967296.dat aborted the run before the filter could skip it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: check the data length before reading a record body in fix -verify A damaged size field at a known record boundary made the scan allocate and read a body of that size before rejecting it. Check that the data length after the header fits the record first, as the resync probe already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: accept a v1/v2 delete chain that reaches the end of the file on its last probe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep an implausible needle timestamp out of the fix -verify resync baseline The data CRC does not cover the v3 timestamp, so a corrupted one passed and then rejected every genuine delete record found after later damage. Report it as a warning instead of using it as the lower bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: stop fix -verify on a read error at a known record boundary An EIO while reading a record was treated like damaged bytes: the scan resynchronised past the unread record and the rebuilt index dropped it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: sync the fix -verify tail backup before truncating the .dat A crash right after the truncate could persist it before the backup's data or directory entry, losing the cut bytes from both files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: let fix -verify -truncateTail retry when a tail backup already exists After a backup succeeded and the truncate failed, the next run hit the existing backup and could not get past O_EXCL. Keep the first backup and save the tail under a new name, as the index backup does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: drop stale index caches before fix -verify swaps in the new index Removing them after the rename left a window where a crash paired the new .idx with the old .ldb, whose newer LOG skips the replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: pin fix -verify fixtures to needle version 3 -verify reads v1 to v3 records, so its fixtures should not follow the build's current needle version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: refuse fix -verify on remote-tiered volumes A remote-tiered volume is read from its remote .dat through the existing .idx, so rebuilding that index from a local .dat would point it at the wrong bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: pick a free backup name when fix -verify retries within one second backupName fell back to path.bak.<unix time> without checking it, so a second retry in the same second reused that name and the exclusive create (or the .idx hard link) failed. Add a .<n> suffix until the name is free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: refuse fix -verify when the volume info cannot be read An unreadable or unparsable .vif may name a remote tier, so treat it like one and keep the existing index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: pass weed fix -verify options explicitly * feat: move weed fix -verify into a weed fix.recover command * docs: weed fix.recover help, point weed fix at it * fix: keep the volume file helpers below runFix Leaves the region between VisitNeedle and runFix as on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: build fix.recover fixtures at needle version 3 fix.recover reads needle versions 1 to 3, so its tests must not follow GetCurrentVersion; writeFixTestVolume now takes the version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: whitefox <whitefox@mayflower.work> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
25f7e8a0fd |
filer: refuse chunk appends onto inline and remote-only entries (#12993)
* filer: refuse unsafe chunk appends * filer: report append representation preconditions * filer: cover cached remote append eviction safety * filer: cover lazy remote append refusal * filer: refuse HTTP appends and offset writes onto remote-only entries An HTTP append or offset write onto a remote-only entry stored the new chunk with nothing below it, so reads returned zeros where the remote bytes were and the entry stopped being remote-only. Small appends failed with a retryable "inline file changed" error instead. Refuse both with a client error, matching AppendToEntry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: AppendToEntry appends after a sparse tail AppendToEntry placed new chunks at the end of the existing chunks, so a file extended past them by a truncate got the appended bytes inside its logical length instead of after it, and its size did not grow. Use the entry size, as the HTTP append path does. 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> |
||
|
|
d2ae75516c |
notification: keep chunk cipher keys out of webhook payloads (#13014)
* filer_pb: scrub cipher keys from both entries of an event Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * notification: keep chunk cipher keys out of webhook payloads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
50fd5c0185 |
codespell: accept the Yandex Disk sandbox URL path (#13015)
* codespell: accept the Yandex Disk sandbox URL path Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * codespell: ignore poligon only inside URLs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f079b68f2b |
filer: grpc_require_token with authenticated filer-to-filer peer calls (#13011)
* filer: require bearer tokens for configured gRPC calls * filer: authenticate owned peer RPCs with per-call admin tokens * filer: retain scoped forwarding refusals with required authentication * filer: preserve tokenless HTTP forwarding outside require mode * filer: honor clock tolerance for gRPC admin fallback * filer: preserve caller token on lock owner forwards * filer: forward caller auth on target ping * filer: authenticate startup peer digest checks * filer: verify required subscription bearers independently of mTLS * filer: assert exact caller bearer on forwarded ping * filer: sign peer tokens with the gRPC verification key peerContext signed filer-owned RPCs with jwt.filer_signing.key only. With grpc_key as the only key and require-mode on, peer calls went out tokenless and were refused. With both keys set, peers that verify with grpc_key and lack the shared-key admin fallback refused the shared-key token even with require-mode off. Sign with the key filesystem gRPC verifies, and keep the shared key for metadata subscriptions, whose verifier accepts admin tokens signed only with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a subscription token's scope over mTLS in require-mode Require-mode admitted a dedicated subscription bearer without the mTLS shortcut, but the handler re-checked it with the certificate, which granted the full stream past the token's prefixes and expiry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: delete uploaded chunks when the write owner refuses authentication A forwarded HTTP append or offset write that the owner refused as Unauthenticated kept its new chunks as if the outcome were unknown, orphaning them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: hand the admitted subscription scope to the handler The handler re-verified a dedicated subscription token after reading the request. If the token expired in between, an mTLS peer fell back to the certificate and got an unrestricted stream. The interceptor now passes the scope it admitted, and the handler refuses it once expired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: accept grpc_key admin tokens on metadata subscriptions A filer with only grpc_key signs peer subscriptions with it, but the subscription verifier checked admin tokens against the shared key only, so with a subscribe key set the aggregator's peer streams were refused. An unscoped grpc_key token already has full filer gRPC access. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: delete the generated manifest when the write owner refuses authentication A forwarded HTTP append that crossed the manifest threshold left the manifest blob it had uploaded orphaned when the owner refused the call as Unauthenticated. The blob alone is deleted, since the manifest also lists committed chunks. 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> |
||
|
|
519c2af3c8 | docs: regenerate star history chart | ||
|
|
a1764358cf |
filer, mount: keep a hard-linked file to one link id and count its names on the filer (#13006)
* filer, mount: keep a hard-linked file to one link id and count its names on the filer A hard link's bookkeeping was done by the client. To link a file a mount reads its entry and sends two writes, an update of the source and a create of the new name, both with a link id and a count of the file's names. Two clients that link one file at the same moment each worked from the entry as it was before the other's writes: - With no link id on the entry yet, each made one up. The second update moved the source to its id, the store took the name off the first, and the first client's new name was left alone on it: one file's chunks under two link ids. - With a link id there, both read the same count and sent it plus one. The record counted one name fewer than the file had. Any write through a name carried the client's copy of the count and replaced the record the same way. Either way the delete of the last counted name deleted the record and the chunks while another name still read them. The filer's own store now counts the names of a hard-linked file itself (countLink): one more when the name written did not hold the link before, the same when it did or when a rename moves it there (WithMovedLink), one for a record that starts. The count sent is not used, and the entry gets the count stored, so the response and the event carry it. The lookup of the name, the count, the record and the name are stored as one change of the record (changeLinkRecord), which DeleteHardLink goes through as well: under a lock per link id, and in a transaction where the store refuses a commit over a change made since it began, run again when it does. A wrapper around a copy of some entries, such as a mount's metadata cache, sees only some of the names and stores the count it is given. UpdateEntry refuses to give a name that holds a hard link another link id that no file has yet (refuseSecondHardLink). The mount sends a file's first link's update as a unary RPC, which keeps that refusal apart from an I/O failure, reads the entry again and links under the id the file has by now. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: take a replicated update's link id without refusing it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: look a path-specific name up outside the record's transaction Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: check the leveldb open and close it in the hard link test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: send a refused first link again from the entry as stored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep a first link's refusal over the next filer's error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: count a hard link's names next to the clients' count instead of in its place The filer's count replaced the one clients send, which lost two things that count did by being worked out ahead: - A link's first write, the update of the source, carries the count with the new name in it already. While the second write is on its way that kept a delete of the source from being taken for the delete of the file's last name (lastLinkDropped goes by the count it read), and the chunks from being deleted under the name about to come. Counted only when it arrived, the new name was stored with chunks that were gone: 104 of 300 rounds of a mount linking a file while another deletes it. - A write of a name the store refused had counted the name already, and sent again counted it once more. The filer now keeps its count of the names in a key of its own next to the record (linkNames), written once the name is stored, and the record gets whichever is higher: the count the client sent or the names counted. It is never lower than what the client alone would have left, and never lower than the names the file has. A record from before has its count recorded as the names when it is first written again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: send a refused first link again with the file's inline content The second attempt builds the new name's create from the entry as the filer has it by now: attributes, chunks and extended attributes. A file the filer keeps inside its entry has its bytes in Content, and the create is what the filer writes the link's shared record from, so without them the record lost the file's content. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: store a path-specific name before the record's lock is let go A second create of the same new name on this filer took the lock between the first one's count and its name write, missed the name, and counted it again: the file's record and chunks then outlived its last name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a link's names key out of the keys of a directory's entries The key began with the link's random id. One that began as the root's entry keys do in a store keyed by path put the names' 4 bytes in the root's listing, and it failed to decode: listing / and the etcd scan under fsck failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: record a hard link's name before it is stored, and take it off if it is not The names counted for a hard link were recorded once the name was stored. On a store without transactions a failure of that write left the name stored and not counted, and the write sent again found the name there and did not count it either: the names recorded stayed one below the names stored, the side a file is deleted under a name from. They are recorded first now, inside the change of the record that counted them, and a name the store then does not take is counted off again (storeCountedName). A failure halfway leaves them one above the names stored, and the file leaked. A name in a path-specific store is recorded with the record as well, and counted off in a change of its own. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: keep a hard link's name counted when a failed write stored it A write whose deadline passes after the store took the name returns an error, and counting the name off then left the names one below the names stored. A later write with the count from before the link lowered the record to them, and the file was deleted under a name it still had. Read the name back first, and keep it counted where that cannot be told. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: carry the stored RemoteEntry into the name a retried first link adds The retry rebuilds the new name from the entry the file has once another client linked it, but kept the RemoteEntry of the entry first read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
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> |
||
|
|
fb0a734dc4 |
feat(remote_storage): add Yandex Disk as a remote storage backend (#13012)
* feat(remote_storage): add a Yandex Disk backend Yandex Disk joins s3/gcs/azure as a remote storage type, so it can back remote mounts and sink replication (filer.remote.sync, filer.remote.gateway) without a separate sink. The Disk API has no buckets and no place for a file's mtime: a top-level folder under yandex_root plays the bucket, and the entry's modification time and content encoding travel as custom resource properties (seaweedfs_modified, seaweedfs_content_encoding; rclone_modified is read too). The client also handles the API's asynchronous operations (202 + operation polling), the short-lived, single-use download links (a fresh link per read and per retry), single-PUT uploads, mkdir -p of an S3-style key's parents, server-side copy for a remote-only rename, and a ranged read that refuses a short body. A caller-supplied endpoint goes through the guarded client like the s3 and azure endpoints. * feat(shell): configure and issue Yandex Disk tokens remote.configure gains the yandex flags (token, client_id, client_secret, root, trash, app_folder, endpoint). A refreshable token is issued in two steps without a browser on the server: -yandex.oauth_url prints the authorization url and keeps the app credentials, -yandex.code exchanges the copied code for a token and stores it. The token and the client secret are masked in the configuration listing. docs/remote-storage-yandex.md walks through the OAuth app, both token flows, the mount and replication commands, and the platform's limits. * fix(remote_storage): handle missing Yandex folders on stat, copy and upload A missing object is confirmed against the bucket folder rather than its immediate parent, as the gcs client does: a key whose subfolder does not exist yet (a rename destination) is a missing object, not a vanished mount, and the sync only proceeds on ErrRemoteObjectNotFound. CopyFile creates the destination's parent folders, so a remote-only rename into a folder the remote does not have yet succeeds. The Disk API answers a missing parent with 409 DiskPathDoesntExistsError; upload and copy treat it like a 404, and the fake answers the way the API does. An operation poll refreshes the token once on 401 and then fails, instead of polling without a pause until the operation deadline. * fix(remote_storage): retry a locked Yandex resource A folder that is still being deleted asynchronously answers a write with 423 DiskResourceLockedError for a moment. The client now retries it with the same backoff as 429/5xx/509, and the error stays transient for the sync's upload retry when the client's retries run out. * fix(remote_storage): harden the Yandex backend after review Traverse reports objects only, like the s3, gcs and azure clients: its callers (remote.cache, remote.copy.local) read the stamp of every entry, and a folder came with none. Deletes no longer reach what they were not meant for. A Disk API delete is recursive, so DeleteFile keeps a folder that took a file's place on the remote, and DeleteBucket removes an empty bucket folder only, the rule S3 and GCS apply to a bucket. CopyFile keeps the destination until its replacement exists: it copies with overwrite and removes the old object (to the trash when configured) only when the service kept it anyway. It refuses to replace a folder, treats a copy onto itself as done, and carries the source's resolved modification time, including rclone_modified and the service's own time. Every metadata request and operation poll has a deadline that covers reading the answer, and a token refresh or code exchange has its own, so a stalled endpoint cannot block the client. Redirects are checked like the transfer links, an endpoint that would send the token over plain http is refused unless it is on a loopback host, a 202 without an operation link is an error, and a read with an offset and no size starts at the offset. * chore(seaweed-volume): keep only the Yandex fields in the remote.proto copy * yandex: retry a failed operation poll One throttled, failed or timed-out status poll ended a wait of up to 30 minutes while the operation kept running on the service, so a large delete or copy was reported failed and redone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * yandex: refresh a token once for concurrent 401s Every request rejected with the same access token replaced the token source, so N concurrent 401s refreshed, and rotated the refresh token, N times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * yandex: retry an operation poll whose answer was cut short A status poll that got its 200 headers but lost the connection before the JSON body ended failed with io.ErrUnexpectedEOF, which the poll retry did not treat as transient, so the wait ended while the operation kept running. 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> |
||
|
|
5e796fa985 |
mount: keep a file's inline content when it is written to or resized (#13009)
* mount: keep a file's inline content when it is written to or resized A small file the filer keeps inside its entry (-saveToFilerLimit, or ?saveInside=true on the upload) has its bytes in the entry's content and no chunks. A mount dropped the content at the first write to the file, or copy into it, and published the write's chunk alone: the bytes the write did not cover read as zeros from then on, for an append as for two bytes in the middle. A change of size left the content as it was. Grown, the file read no further than its content on the mount and as zeros through the filer; cut and grown again, it had the bytes that were cut off back. The content now becomes a write of the handle's own, older than the one about to change the file, and is flushed with it as a chunk (bufferInlineContent: Write, CopyFileRange, Fallocate). SetAttr cuts it to a smaller size, and stores it as a chunk before the file grows past it (resizeInlineContent). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: store resized inline content in chunks of the mount's chunk size A file that grows past its inline content had the content stored as one chunk, whatever its length, where a buffered write is split at the mount's chunk size: content longer than a volume server takes in one upload could not be stored, and the file could not grow. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
bd1f24a09b |
mount: carry a file's inline content into the name a hard link adds (#13008)
* mount: carry a file's inline content into the name a hard link adds A small file the filer keeps inside its entry (-saveToFilerLimit, or ?saveInside=true on the upload) has content and no chunks. To link it a mount updates the source and creates the new name, and the filer writes the link's shared record from each of the two. The create carried the source's attributes, chunks and extended attributes but not its content, so the record was left with a size and nothing behind it: both names read zeros from then on, through the mounts and through the filer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: carry a remote-only file's RemoteEntry into the name a hard link adds A file under a remote mount that is not cached yet has no chunks and no content; its RemoteEntry is what sends a read to fetch the object. The create of the new name left it out, so the hard link's shared record lost it and both names read zeros. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: cache a remote-only file before a hard link gives it a new name The filer resolves a remote object from the name a read goes through, and the new name has no object of its own, so a read through it failed until the source name had been read. The link now has the filer cache the object first, so every name shares its local chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: cache a linked remote-only file through its open handle The cache moved the stored entry off the base of a handle open on the source, so the handle refused the link change and its next flush failed. A handle with buffered writes now publishes them first, and the cache goes through the handle as a read does, which moves its base along. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
8abfdf1e21 |
s3: abort in-flight requests whose access is revoked (#12986)
* s3: abort in-flight requests whose access is revoked S3 checks access when a request starts, so a download or upload that started before an identity, policy or bucket policy change runs to its end. With -s3.abortRevokedRequests the gateway re-checks the requests it is serving after such a change and aborts the ones now denied: an HTTP/1.x request has its connection closed, an HTTP/2 request is canceled. The re-check looks the identity up again and repeats only authorization, not the signature check, so clock skew or an expiring presigned URL never cuts a long transfer. Off by default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * s3: check revoked requests against whole reloads and configured identities - A re-check pass holds reloadMu, so it never sees identities installed before their policies are synced. - STS and JWT sessions are not tracked: re-validating their token checks its expiry, which a re-check cannot tell from a revocation. - A request whose access changed while it was being admitted is checked again once it is tracked. - The identity source comes from how the request authenticated, and a rotated secret revokes the requests signed with the old one. - An aborted HTTP/2 request also has its body closed. - Browser form uploads, which their handler authorizes, are not tracked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * s3: track SigV2 requests that carry a session token SigV2 never reads a session token, so a configured key that sent one was classified as a session and skipped the re-checks. Only SigV4 resolves a token, and it marks one it tolerated for a configured key ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: let the admission-race test pass only through the generation check The re-check that the change schedules could run after the request was tracked and abort it, so the test passed without the generation check. Wait for that pass to take its snapshot before the request starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: drop the executable bit from the revocation test file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: bump the re-check generation before its scope can be taken scheduleRevalidation released t.mu before bumping the generation. A pass already kicked could take the new scope in between, before a request was tracked, and that request then saw the old generation and was never checked again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: judge a re-checked request as of when it was admitted A re-check evaluated aws:CurrentTime and a key's expiration at the time of the pass, so an unrelated change aborted a transfer whose time-bounded grant expired after it started. The re-check's copy of the request now carries its admission time, which RequestConditionValues uses for aws:CurrentTime and aws:RequestTime, and a key's expiration is compared with it too. A test covers a revoked HTTP/2 upload: closing its body releases the blocked read, and a download on another stream of the same connection runs to its end. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * stats: let http.ResponseController reach the writer under StatusRecorder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: reset a revoked HTTP/2 request's stream A deadline in the past resets only that stream, so a download blocked writing to a client that stopped reading is released too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: keep in-flight requests when their key's secret is rotated A new secret for the same access key is a rotation, not a revocation. Removing or deactivating the key, or losing the grant, still aborts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: always abort in-flight requests whose access is revoked Drop -s3.abortRevokedRequests: the gateway tracks the requests it admits and re-checks them on every change that can revoke access, so a revoked client's transfers stop without a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: a catch-up re-check does not advance the revocation generation A request tracked after an access change scheduled its bucket's re-check through the same path as the change, which advanced the generation again. A request that began authenticating before that advance then scheduled another bucket-wide re-check, so overlapping admissions could keep the re-check loop busy, holding reloadMu, with no access change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
802be6dd7b |
volume: vacuum keeps a needle's own unexpired TTL and checks against an independent index tally (#12987)
* volume: vacuum keeps a needle's own unexpired TTL on a volume without TTL Vacuum measured a needle's expiry against the volume TTL. On a volume without TTL that is zero, so every needle carrying its own TTL was dropped by the first vacuum while reads still served it. Fall back to the needle's own TTL and append time, the rule reads use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): vacuum applies a needle's own TTL on a volume without TTL Rust vacuum kept every needle with its own TTL on a volume without TTL, even long after reads stopped serving it. Use the read path's expiry rule there, matching the Go vacuum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: check vacuum against a tally taken while loading the index The compacted-size check summed its expected bytes inside the loop that copies, so an entry the traversal never visited was missing from both sides and the check could not see it. Tally the live entries while replaying the .idx rows, count every copied, expired and unreadable needle, and fail when they do not add up to the snapshot. The explicit accounting also covers volumes with a TTL, so they are checked too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): check vacuum against a tally taken while loading the index Mirror the Go change: tally the live entries while replaying the .idx rows, count every copied, expired and unreadable needle, and fail when they do not add up to the snapshot, on volumes with a TTL too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: treat a TTL flag without TTL bytes as no TTL A record can set the TTL flag and end before the TTL field, leaving Ttl nil. Checking such a needle's own TTL panicked in reads and, now, in vacuum on volumes without TTL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: log each TTL-expired needle vacuum drops Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): log each TTL-expired needle vacuum drops Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e13f36275b | filer: rename a directory that holds a hard link on SQL stores (#13001) | ||
|
|
432826f1b2 | filer: allocate the interval points of readResolvedChunks at once (#12995) |