mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
6e91dc97b8fe37f99eaf1cfbbe1685e107e2cee5
21893
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6e91dc97b8 |
worker: reject a task at capacity without blocking the manager loop (#13453)
* worker: reject a task at capacity without blocking the manager loop * worker: gofmt the capacity test and trim its comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: report a task rejected at capacity back to the admin The admin marks a task assigned before sending it, has no assignment timeout, and only reclaims tasks from workers whose heartbeats stop. A worker that rejects a task at capacity keeps heartbeating, so the task stayed assigned to it and blocked further work on its volume. Report the rejection as a failure so the admin reschedules it. 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> |
||
|
|
2637ff09c5 |
mount: answer ESTALE for an inode whose name the filer no longer has (#13447)
* mount: answer ESTALE for an inode whose name the filer no longer has
A job that writes a status file through a tmp name retried a failed
round by opening the tmp name again. The kernel still resolved the name
to the failed round's inode, and the mount still mapped it, but the filer
had no such file: the open failed with ENOENT although it asked for
O_CREAT, and the job exited.
lookupEntry already logged such a tracked name ("filer ErrNotFound for
tracked path"). It now drops the name from the inode table when no open
handle and no pending flush owns the inode, and requests for the inode by
node id answer ESTALE (maybeReadEntry, AcquireHandle), as
pathlessInodeStatus already does for an inode without a name. The kernel
looks the name up again and, for an open with O_CREAT, creates the file,
which gets an inode of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: drop a vanished name only while it maps to the inode looked up
lookupEntry read the name's inode after the filer answered. A rename
that gave the name to another inode while the request was in flight, a
directory say, had that inode's name dropped on the strength of an answer
about the name as it was. The inode is now taken before the request, and
the name is dropped only while it still maps to that one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: keep the vanished name mapped; ESTALE alone has the kernel look again
Dropping the name raced with an open of the same inode: a handle
published between the check for one and the removal, or just after it,
had no name left, so a peer's rename of that name no longer reached it
and its flush went to the old name. pathlessInodeStatus answers ESTALE
for any inode the kernel still holds, so maybeReadEntry and AcquireHandle
get the kernel to look the name up again without the table losing it.
A file created at the name meanwhile reuses the inode number, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
68f99dc114 |
seaweed-block: docs: no read of the line confirms a failover stays (#13449)
* seaweed-block: docs: read the line again before relying on a failover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: a read of the line is a snapshot, not a confirmation The queued rebalance applies when blockmaster's assignment queue reaches it, so a second read can come before it as well. Say that no read confirms the primary stays, and that the guest is started again on the new primary if it moves later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
16a6a70a08 |
mount: keep delayed events about an earlier file off the next file at its name (#13445)
* mount: keep delayed events about an earlier file off the next file at its name A writer that publishes a status file by writing NNNN.json.tmp-PID, fsyncing it and renaming it over NNNN.json recreates the tmp name every few seconds. Without -writebackCache a mount applies its own events from the metadata subscription after the local apply (the events of a rename stream carry the response time, not the log position, so the dedup ring does not match them), and their invalidations reach whatever file sits at the path by then. With about 200 such writers in one directory, two of these events failed a round of the next file: - the rename of round k moved round k+1's tmp file to NNNN.json. Its handle published under that name and was refused (EIO); the retry wrote into NNNN.json, and the rename of the tmp name failed with ENOENT. - the create of round k became the entry and base of round k+1's file, and every flush of the round was refused (EIO). Both hit the new file in the window in which Create had put its handle in the map but not yet marked it an unpublished create: it did that afterwards, holding no lock, so the event found a clean handle with a base and took it for a published file. On master the second event, which carries the inode number the creating mount stored, makes the handle give the name up instead (replacedByAnotherFile) and marks it deleted: its writes are never published, and close returns success. - AcquireCreatedFileHandle puts a new handle in the state the create leaves it in before the handle is in the map. An existing handle, whose inode number outlived an earlier file, is installed under its lock. - An invalidation carries which file its event is about: the inode number the file's creator stored and its creation time (hard links excluded). An open handle ignores a rename of another file, and any other event about an earlier one (another number, created before the file held). A later file at the name still reaches the handle. - MovePath takes the inode number a rename event reports. A source that maps to another inode, while the table knows the renamed file by that number, holds another file and stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: judge another file by its creation time only for this mount's own events A peer's file can take the name with an older creation time: renamed in from another name, or created on a host whose clock runs behind. Dropping its event left the name on the replaced file's inode. A peer's rename can also name a file by a stored inode number another file here holds, when two mounts made the same path within one second, and was refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: a delete of another file at the name leaves the open handle alone Like a rename, a delete names the file it removed. A peer's delayed delete of an earlier file at the name, logged by a filer other than the one behind the handle's version, marked the held file deleted and dropped its writes. 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> |
||
|
|
120d786818 |
mount: update a directory's times once, without retries (#13443)
* mount: update a directory's times once, without retries touchDirMtimeCtime sent its UpdateEntry through saveEntry's retries, 1, 2 and 4 s apart. Every create, link, rename and removal in the directory waits for that update and ignores how it went. In a directory many writers share, the update of its entry conflicts in the filer store with theirs (TiKV reports "write conflict"), and the call waited out the backoffs: in one directory about 200 jobs shared, three mounts logged 3646 such retries in two hours, each holding a create or a rename for up to about 7 s. saveEntry takes a bestEffort flag: such an update is tried once and its failure logged at V(1). touchDirMtimeCtime sets it; setattr and the xattr calls keep their retries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: shorten the directory times 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> |
||
|
|
373eb29e59 |
s3tables: table policy, maintenance and tag operations refuse a view (#13439)
* s3tables: table policy and maintenance reads refuse views and unfinished records readTableMetadataAttr only checked that the table-metadata attribute was present, so the table policy and maintenance operations accepted a view or a record a create or rename had not finished writing. Route it through tableMetadata, the check GetTable and the other table operations use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3tables: tagging a table ARN refuses a view or unfinished record TagResource, ListTagsForResource and UntagResource read the table-metadata attribute directly for a table ARN, so a view or a record still being created or renamed under that name took and answered tags as a table. Read a table target through readTableMetadataAttr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3tables: table record writes refuse a view requireTableCreatedAt compared only the creation time, so a view holding the name at write time was not rejected on its own. Refuse it, so table policy, tag and maintenance writes never land on a view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3tables: test table operations against a view and an unfinished record Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ca5c659d9b |
s3api: answer a malformed SSE-KMS key ID with KMS.NotFoundException (#13433)
* s3api: answer a malformed SSE-KMS key ID with KMS.NotFoundException PutObject and UploadPart with an SSE-KMS key ID that has spaces or control characters returned 500 InternalError, which clients retry. CopyObject already answers the same ID with KMS.NotFoundException, the error a KMS gives for a key ID it can't parse. PUT and UploadPart now do too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: refuse a malformed SSE-KMS key ID at CreateMultipartUpload AWS answers a key ID it can't use at CreateMultipartUpload. A malformed one was accepted there, so every UploadPart of the upload failed instead. ValidateRequestEncryption now answers it with KMS.NotFoundException, which also covers PutObject before a bucket auto-create. 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> |
||
|
|
90aae21e6b |
kms/local: read key_material from ${ENV} references (#13434)
A local KMS key's key_material can now be written as ${NAME}, so the key
can come from a Kubernetes Secret, or any secret store that hands it to the
process as an environment variable, instead of sitting in the config file.
This works in the S3 JSON config and in filer.toml.
A reference to a variable that is unset or empty, or one that isn't written
as ${NAME}, fails the load with an error that leaves the reference and the
material out. The expansion is the one static S3 credentials already use,
moved to weed/util so both share it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
adb07ee3ce |
s3api: answer GET with the KMS error when the KMS won't decrypt (#13432)
* s3api: answer GET with the KMS error when the KMS won't decrypt A GET of an SSE-KMS object whose key the KMS no longer holds, or refuses to use, returned 500 InternalError, which clients retry. PUT and CopyObject already answer the same KMS errors with their S3 codes, like KMS.NotFoundException. GET now does too, on the full, per-chunk key, range and directory content paths. The per-chunk key path wrapped the decrypt error with %v, which dropped the KMS error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kms: report a provider outage as an internal failure GET now answers a KMS error with its S3 code, so a provider outage that the converters tagged as a key error turned a retryable read into a 400 that blames the key. OpenBao and Azure 5xx answers and GCP Unavailable or DeadlineExceeded matched the "not found" or "unavailable" substrings, and AWS KeyUnavailableException is retryable per the KMS API. All of these now map to KMSInternalException, which S3 answers as 500. 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> |
||
|
|
04a93bd7dd |
s3api: support UploadPartCopy from SSE-KMS sources (#13431)
* s3api: support UploadPartCopy from SSE-KMS sources UploadPartCopy from an SSE-KMS source returned 501, so `aws s3 cp`, `mv` and `sync` failed for SSE-KMS objects over the multipart threshold. The re-encrypting copy path now decrypts the source the way GET does: chunks with their own SSE-KMS metadata decrypt with it, and a source without any uses the entry-level key. A ranged copy starts at the chunk holding the range, so copying the tail of a large object doesn't fetch and decrypt everything before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: start an SSE-S3 part copy at the chunk holding the range A ranged UploadPartCopy from a per-chunk SSE-S3 source fetched and decrypted every chunk before the range and discarded it, so copying a large SSE-S3 object part by part read the source quadratically. Start at the chunk holding the range start, as the SSE-KMS path does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: answer UploadPartCopy with the KMS error when the source won't decrypt A part copy from an SSE-KMS source whose key the KMS no longer holds, has disabled or refuses answered 500 InternalError, whether the refusal came while opening the source or mid-stream. Answer it with the KMS error, as PUT and CopyObject do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: refuse an SSE-KMS part copy over chunks of another SSE type A source mixing SSE-KMS chunks with SSE-S3 or SSE-C ones would stream the foreign chunks through as plaintext, copying their ciphertext into the destination part. Refuse the copy before fetching anything. 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> |
||
|
|
6c0859349b |
s3api, iam: match policy variable values literally (#13413)
* wildcard: match expanded variable text literally Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: match policy variable values literally in resource, action and principal patterns Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: match policy variable values literally in Like conditions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * iam: match policy variable values literally in role policies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ba4370183a |
s3api: keep the derived aws:s3:arn in a CopyObject SSE-KMS context (#13451)
* s3api: keep the derived aws:s3:arn in a CopyObject SSE-KMS context ParseSSEKMSCopyHeaders took the destination context header verbatim, so a copy could carry no aws:s3:arn or name another bucket's ARN, and a KMS key policy conditioned on aws:s3:arn could be met that way. Without the header, the default context was built from the filer path, which made the ARN arn:aws:s3:::b//buckets/b/key. Build the destination context the way PutObject does: the derived ARN of the destination object plus the client's extra keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: reject a CopyObject SSE-KMS context the KMS would refuse The copy validation only checked that the context header was non-empty, so a malformed context failed later, after the copy had started, with InternalError. Apply the same checks PutObject applies and answer InvalidRequest up front. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: answer InvalidRequest when the destination KMS context is refused The derived aws:s3:arn of a destination key with a control character fails the KMS context checks, and the copy answered InternalError. Return it as a CopyValidationError and let the copy error mapping honor that type, so the client gets InvalidRequest as PutObject does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
20854b3a66 |
seaweed-block: docs: a no_progress answer or exiting does not stop a snapshot delete run (#13459)
* seaweed-block: docs: exiting or a no_progress answer does not stop a snapshot delete run Review: a write the earlier run already sent to the filer can still land after a no_progress answer, a timeout or the command's exit, so the note asks for the earlier run's final answer before a resume, says waiting for the filer only lowers the risk, and says resumes the volume host starts on its own are outside the operator's control in v1.1.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: v1.1.1 has no reliable workaround for an overlapping snapshot delete Review: waiting for a final answer or for the filer is not a workaround an operator can rely on. The note now says there is none in v1.1.1, that not re-running or resuming an interrupted snapshot delete by hand reduces exposure, and that the fix is planned for v1.1.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: the volume host retries only its own delete, for up to 30 seconds Review: the host never picks up a delete the command started; a delete sent to the host is retried by the host itself for up to 30 seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: the outstanding filer write, not a live run, is what makes a resume unsafe Review: the trigger described an earlier run that is still alive, so an operator could read a terminated process as ruling it out. The trigger and the advice now name the filer write the earlier run already sent, which can land after a no_progress answer, a timeout or the command's exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: a paused run has not sent its page update yet Review: the trigger now names both cases of an update that has not landed: the earlier run's process paused before sending it, or the update sent and not yet applied by the filer. Only in the second case need the earlier run not still be running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: name the failures the volume host retries Review: the host retries its own delete for up to 30 seconds only while an attempt answers layout_busy or head_conflict; any other failure, including no_progress, is returned at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: the host retry applies only on a version-1 HEAD Review: a version-0 HEAD takes v1.0's name-only delete, which the host does not retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: the issue needs a version-1 HEAD Review: a version-0 or absent HEAD takes v1.0's name-only delete, which stages no intent pages, so it is not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: 30 seconds is the host's retry threshold, not a bound Review: the host checks its deadline before each wait, so its last attempt can start and run past 30 seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: the host retries for about 30 seconds Review ruling: the plainer, strictly weaker wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ab25506331 |
seaweed-block: docs: known issue: resuming a snapshot delete that is still running (#13454)
* seaweed-block: docs: known issue: resuming a snapshot delete that is still running Two overlapping runs of one snapshot delete, with a cleaning pass between, can record the delete with an intent page whose data was freed; every later snapshot delete on the volume is then refused (queue_full) and the volume's cleaning stops. The v1.1.1 notes give the trigger, the effect, what to do, and that v1.1.1 has no recovery for an affected volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-block: docs: a stuck snapshot delete answers layout_busy, not queue_full Review: with the intent stuck, a later snapshot delete stops at the catalog's pre-check and answers layout_busy, a retryable answer that does not clear on retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
acc22a4270 |
seaweed-block: docs: known issue: a queued rebalance can undo an operator failover (replicated preview) (#13444)
Docs only. Includes the maintainer's #13446 (the commands to check and redo the primary after a failover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e17e30b4aa |
seaweed-block: keep only the runner scenarios this tree uses (#13418)
Removes lab-only runner scenarios and suites from seaweed-block/, keeps the scenarios this tree's CI uses with environment placeholders, and guards every artifact-root use before any cleanup. Includes the maintainer's follow-ups from #13419 and #13423. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f92efd4437 |
seaweed-block: docs: re-point stale model action citations (#13437)
Docs only: model action citations in the trace table, invariants and time bounds point at the current DeleteRetire actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fe2d016c41 |
seaweed-block: docs: cite PlainSealReplay for the seal-replay invariant; drop removed scoped-GC prose (#13429)
Docs only (seaweed-block design invariants and trace). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cf3eda7e57 |
perf(s3vectors): read the bucket once per authorization (#13427)
s3vectors: read the bucket once per authorization Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
68d56d8ff8 |
mini: admit volume servers started against the embedded master (#13416)
* mini: admit volume servers started against the embedded master A single-master weed mini pinned its embedded volume server as the only admitted reporter, so the master refused every extra weed volume pointed at it. Use the expected-reporter release a single-master weed server already uses: the embedded server's first clean inventory still collapses the post-mint allocation hold, and other volume servers are admitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mini: test that a single-master mini does not pin its volume server Move the reporter choice into setMiniExpectedReporter so a command-level test can check it: the embedded volume server is the expected reporter in single-master mode, never the only admitted one, and a multi-master rerun clears it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
39f568f614 |
wdclient: use a master only after it answers as the leader (#13415)
* wdclient: use a master only after it answers as the leader Since the announce gate was added, every client marked a master as current as soon as its KeepConnected stream opened, before the master answered. When that master is a follower, its answer only names the leader, but calls made in the meantime go to the follower, and leader-only ones (lock, volume.list, collection.*, ...) fail with "raft.Server: Not current leader". A weed shell fed a script runs its first command right in that window. Keep the early hand-out for clients behind an announce gate (a starting filer), and let other clients wait for the first answer as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: start the follower check only after it got the registration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: hand out a master early only while the announce gate is closed A filer that already announced and reconnects after a failover kept the early hand-out, so calls waiting in GetMaster went to a follower that had not answered yet and failed with "Not current leader". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: stop handing out a master once it redirects to the leader A filer that reached a follower behind its announce gate kept that follower as the current master after the redirect, until the leader answered, so leader-only calls in that window failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: keep the redirecting master when canceled before the leader answers Clearing the current master on a redirect left it empty if the client was canceled before the hinted leader answered, so a later GetMaster without a deadline blocked forever. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4a58968439 |
Cut per-request CPU on filer gRPC tokens and S3 header scrubbing (#13414)
* security: reuse the filer admin token signed in the same second An admin token's only claim is its expiry, which jwt truncates to the second, so every token signed with one key in one second is the same. Each filer gRPC call from a client with a filer signing key signed a new one: about 4us and 40 allocations per call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: add a filer token without copying the outgoing metadata WithFilerToken copied the outgoing metadata twice on every filer gRPC call to check for an authorization the caller set and to add its own. Look the key up in place and append the token instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: canonicalize the scrubbed internal header names once scrubInternalHeaders runs on every request, and Header.Del canonicalized each of its nine names again; five are not in canonical form, so each request allocated their canonical forms anew. Delete the precomputed canonical keys instead: 775ns and 5 allocations down to 120ns and none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: benchmark the token path with a fixed key, test the reuse itself Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: keep GenJwtForFilerAdmin's doc comment on the function Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f9febc7ee5 |
filer: a store's listing expires an entry as the filer does (#13399)
* filer: a store's listing expires an entry as the filer does The tikv and redis stores remove the entries a listing finds expired, and judged that by Crtime + TtlSec. For an S3 object the filer counts from mtime instead, and an overwrite keeps Crtime while it moves mtime. So a listing deleted an S3 object that was overwritten within its TTL: a GET still returned it, and after one ListObjects it was gone. The same check dropped a directory carrying a TTL from an older build, stranding what it holds, which the filer's lookups refuse to do. These stores, and the rocksdb compaction filter, now use Entry.ExpiresAt. * filer: trim the store expiry comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0ce344d559 |
redis3: remove names left by expired entries, fix skip-list split and listing (#13408)
* redis3: a listing removes the names of expired entries from the directory A listing skipped the name of an entry whose value redis expired and left it in the directory's list for good, so the list key also outlived the directory's last entry. For an entry past its TTL it ran ZREM on the list, which in this store is a string key, so that name stayed as well. Both now leave the directory's list once the walk ends, under the list's lock and only when the master holds no value for the name, so an insert that wrote its value first keeps its name. An entry past its TTL is deleted only if it still holds the bytes the listing judged expired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: a lookup removes what a redis-expired entry left behind The filer asks a store that implements ExpiredLeftoverStore to clean up after a lookup that missed under a TTL rule, as the redis and redis2 stores do. redis3 now removes the name from the directory's list too, checking the list first so a miss on a name never written costs only the reads of the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: key the upper half of a split node by its smallest name When a full node splits and the new name goes to the lower half, the upper half was keyed by that new name, which it does not hold. Deleting the name then matched the upper node by key and removed nothing, so the name stayed listed, and listings from a start name could come back out of order. Only a directory list of more than one node splits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list from a start name inside an earlier node A listing from a start name that falls inside a node, rather than on a node's key, began at the next node and skipped the rest of the node that holds the start name. A paged directory listing resumes from the last name it returned, so every page after the first lost names once the directory's list had more than one node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: check a lookup's name against the one node that would hold it The check that a missed name is still listed walked the list from that name, which fetched the rest of its node, up to a million names, to look at the first. It now asks that node for the one name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: stop a list change on a failed read of a node's smallest name NodeMin returned "" for a failed read as for an empty node. Deleting a node's key name then dropped the whole node with the names it still held, and a split keyed a node by the empty name. It now returns the error, and both stop on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: an update that finds its value expired lists the name again UpdateEntry only wrote the value. When redis expired the value between the caller's read and the update, a lookup or listing could take the name out of the directory in between, and the update left a live entry that no listing shows. The value is now written by a script that also reports whether one was stored, and an update that found none adds the name back, under the list's lock as an insert does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: read a split node's new smallest name before changing the list A split that failed this read had already unlinked the node and saved the new lower node, and returned before the list header was saved, so the names of the node were no longer reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: return a failed read of a node's membership A failed read passed for a missing name: a lookup's leftover check reported no leftover, and a delete returned success with the name still listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: take back an update's value when listing its name fails An update that found its value expired wrote it again and then listed the name. If listing the name failed, the value stayed, so a retry found it stored and returned without listing the name. The value is now deleted again if it is still the one written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: stop a list change on a failed count of a node's names NodeSize and NodeInnerPosition read 0 from a failed ZLEXCOUNT. A delete then took the node for emptied and dropped it with the names it still held, and a split added the name in a node of its own ahead of the names before it, so listings came back out of order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: read the directory list from the masters when changing it With useReadOnly or routeByLatency, redis_cluster3 sent the reads of a list change to replicas. A lagging replica could miss a node's other names, and the delete that read it dropped the node with them; a listing or a lookup that removes an expired name now runs that delete too. List changes and the EXISTS checks before them go through a second cluster client that reads from the masters, created only when the store reads from replicas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list an expired update's name before writing its value back An update that wrote back an expired value and then failed to list the name deleted the value again when it still held the update's bytes. A concurrent write of the same bytes was deleted with it, and a failed delete or a concurrent update of other bytes left the value without its name for a retry that no longer looked. The update now writes with SET XX. When the value is missing, it lists the name and then writes the value under the list's lock, which the removal of an expired name also takes. A failure leaves the value missing, so the retry lists the name again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list an updated name again when the list lock's lease ran out An update that finds its value missing lists the name and writes the value under the list lock. If the write outlasts the lock's lease, another filer's cleanup can take the lock, see no value and remove the name before the value lands, leaving a value no listing shows. Unlock now reports a lost lease, and the name is then listed again under a new lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list a cleaned-up name again when the list lock's lease ran out A listing or lookup removes a name after finding its value missing under the list lock. If the removal outlasts the lock's lease, an update can list the name and write its value in between, and the removal then takes out the name of a live value. Unlock now reports a lost lease, and the name is then listed again; if its value is still missing, the next listing removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list the name again when a change fails after the lease ran out A cleanup that lost its lease could remove the name from its node and then fail on the next read. The failed change skipped the lease check, so the name of a value written in between stayed removed. The lease is now checked whenever a write or check ran under the lock, and the change's own error is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: retry listing a name again after the lease ran out Listing the name again after a lost lease is the only thing that lists a value another filer wrote in between. A transient failure of that one attempt left the value unlisted, so it is now retried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis3: list an inserted name again when the list lock's lease ran out An insert's list change made after the lease ran out could be overwritten by another filer's change based on an earlier read of the list, dropping the name while its value stays stored. Every insertChild now ends with the lease check, so the name is listed again, as an update's already was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
63c50b8cfe |
seaweed-block: v1.1.1 notes list five more known issues (#13420)
Matches the published v1.1.1 release page. Docs only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ad5d7338bc |
seaweed-block: neutral names and no lab notes in the public tree (#13417)
Replaces internal identifiers in seaweed-block/ docs, specs and comments with neutral wording. Wording only: no code behaviour, test assertion or spec meaning changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a5686e7fa7 |
Sync seaweed-block v1.1.1 into seaweed-block/ (#13411)
Brings seaweed-block main (v1.1.1 plus the docs and a test fix after it) into seaweed-block/ as one commit. Only files under seaweed-block/ change, and the subtree equals seaweed-block main exactly. The module's full history stays in the seaweed-block repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
58b8e0ba89 | docs: regenerate star history chart | ||
|
|
2bbb50fe7c |
codespell: accept 'lits' (Go AST literals in seaweed-block tests) (#13412)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d84235e74f |
s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3 (#13378)
* s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3 AWS encrypts an SSE-KMS request that sends no key ID with the aws/s3 managed key. PutObject, UploadPart and CreateMultipartUpload passed the empty key ID on, and the KMS call rejected it, so the request failed with 500. A bucket default of aws:kms without a key failed the same way for multipart uploads. CopyObject was worse: its copy paths read an empty key ID as no SSE-KMS, stored the data unencrypted or under the source key, and marked the object as SSE-KMS, so reading it back returned garbage. Resolve an empty key ID to alias/aws/s3 wherever a request or a bucket default is read, with the helper the bucket default uploads and copies already had inline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: re-encrypt an in-place SSE-KMS copy that changes the key The key-rotation strategy handed back the source chunks for an in-place SSE-KMS copy, so an object copied onto itself under another key, or under alias/aws/s3 when the request names none, stayed encrypted under the old key. Route it through the re-encrypt copy, which already keeps the same-key case direct. 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> |
||
|
|
56e95e5ebd |
filer: keep chunk encryption on server-side copy (#13392)
* filer: reproduce overwritten bytes lost by server-side copy Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: retain chunk modification time during server-side copy Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: isolate the copy regression volume-location cache Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: reuse fake master in chunk copy regression Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: share the chunk copy test fixture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep chunk encryption on server-side copy The copy sent each needle with the chunk's clear size as its length, so a chunk encrypted by the filer (ciphertext is longer) failed to copy. Chunks also lost their cipher key, compression flag and S3 SSE metadata, which a reader needs to decode the copied bytes. The upload now takes the stored length and the copied chunk keeps those fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Signed-off-by: Perfloop Agent <agent@perfloop.ai> Co-authored-by: Perfloop Agent <agent@perfloop.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e9ea21340b |
filer: a lookup removes what a redis-expired entry left behind (#13397)
* filer: a lookup removes what a redis-expired entry left behind Redis expires an entry's value on its own and leaves the name in the parent directory's list. A listing drops such a member when it meets it, but a lookup finds nothing and returns, so the names of entries nobody lists stay, and so do the directories they leave empty. The filer_ttl job expires entries by looking them up and cannot reach them either. A lookup that finds nothing under a filer.conf TTL rule now asks the store for what expiry left of that name. The redis stores remove the list member, guarded against a concurrent recreate as on a listing, and when there was one the filer removes the directories this leaves empty, as a listing that meets an expired entry does. A miss with no member to remove costs one command, and only under a TTL rule. * filer: keep a directory that holds an object when removing empty parents A file promoted to a directory by a child write keeps its own object data. Once its last child expires the directory is empty, and the cleanup deleted it along with that object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: report a failed removal of a redis-expired leftover RemoveExpiredLeftover returned a nil error even when the redis SREM or ZREM failed, so the filer could not log why an expired name stayed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: check a redis orphan repair's keys on the master With useReadOnly or routeByLatency the cluster client sends EXISTS to a replica. A lagging replica misreads a just-written value as absent, and the repair then drops a live entry from its directory list. A lookup miss now reaches this repair, so check the keys with a script, which runs on the master, as the redis2 store already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: a lookup's cleanup leaves directories alone and asks the master first Removing the directory a redis-expired entry left empty from the lookup went through DeleteEmptyParentDirectories, which makes none of the empty folder cleaner's checks. With a leftover as the trigger it removed a multipart upload's staging directory together with .uploads, a directory of a bucket that keeps empty folders, an S3 Tables catalog directory, and the directory of a file written between its emptiness check and its delete, which strands that file. The lookup now only has the store remove the name; the directory stays. The redis stores also check the master for the value before they touch the list. A lookup that missed on a lagging replica used to remove a live entry's member and put it back, and a failure in between lost it. * redis: a lookup's cleanup looks for the member before it asks the master Most lookups that find nothing are of a name that was never written. Those now cost one read of the directory list instead of a script and a removal; only a name the list still holds is checked on the master. * redis: retry the restore of a directory list member, and report a failure The orphan repair removes a member and puts it back when the value turns out to be stored, because an insert got in between. Nothing else puts that member back, and a failed restore was only logged, so the entry stayed out of its directory's listing until it was written again. The restore is now retried a few times, and a restore that still fails is returned as an error. * redis: keep restoring a directory list member until redis takes it A restore that failed every attempt left a live entry out of its directory list for good, since nothing else puts the member back. Retry it in the background until it lands or the store closes; the repair still reports the failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3afc4e30bf |
worker: filer_ttl expires S3 objects in buckets without lifecycle rules (#13396)
* worker: filer_ttl expires S3 objects in buckets without lifecycle rules The job skipped every entry carrying the S3 expiry flag, to leave lifecycle expiry to s3_lifecycle. The filer puts that flag on any S3 object it gives a TTL, a filer.conf path rule's TTL as well, and s3_lifecycle only evaluates buckets that have lifecycle rules. So the rows of objects uploaded through S3 under a plain path TTL were never removed unless something looked them up or listed their directory. A flagged entry is now left to s3_lifecycle only in a bucket with lifecycle rules, read with the loader that job uses. Elsewhere the job expires it at the time the filer's lookups do, which for an S3 object counts from its mtime. * worker: filer_ttl leaves S3 objects to s3_lifecycle only where rules stamp TTLs Lifecycle rules put a TTL on an object only in a bucket with the lifecycle TTL fast path on. In any other bucket the TTL of a flagged object came from a path rule, and s3_lifecycle, which expires by its rules, never removes it: a bucket whose only rule aborts multipart uploads, or expires another prefix, kept such objects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: filer_ttl leaves a bucket to s3_lifecycle only for a rule the fast path stamps A fast-path bucket whose configuration is empty, or holds only rules that expire nothing after days (abort multipart uploads, noncurrent versions, tag filters), stamps no TTL, so its flagged objects carry the path rule's TTL like any other bucket's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: filer_ttl defers only the objects a stamping rule matches A fast-path rule stamps its TTL only on keys under its prefix and within its size filters, so another object in the same bucket got its TTL from the path rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: filer_ttl lists each rule once more for the S3 objects its cursor passed The cursors saved so far moved past every S3 object, which the replay skipped, and nothing lists a rule that has a cursor. They are now saved under a new name, so after the upgrade each rule is new once: it is listed, which removes the expired objects, and replayed from a fresh cursor. * worker: filer_ttl defers only a TTL the fast path stamped A flagged object whose TTL differs from the one its matching fast-path rules stamp got it from a path rule (a multipart upload, or an object written before the rule), so filer_ttl expires it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: filer_ttl lists a rule again when its buckets' fast-path rules change The replay moves past an object it leaves to s3_lifecycle. Each cursor now keeps a signature of the fast-path rules of the buckets its rule covers, and a different signature has the rule listed, which removes the objects whose lifecycle rule was removed or changed once they are due. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: filer_ttl quotes the prefixes it hashes into a lifecycle signature A prefix holding a tab or newline could make two rule lists hash alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
69c2cff0d8 |
admin: show the configured S3 endpoint in the service account CLI example (#13395)
* admin: show the configured S3 endpoint in the service account CLI example The credentials modal always printed AWS_ENDPOINT_URL=http://localhost:8333. Use s3.public_endpoint from admin.toml (or weed mini's own S3 address) when it is set, and keep localhost:8333 only as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: test the service account CLI example endpoint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: shell-quote the S3 endpoint in the service account CLI example A configured endpoint may contain characters such as ';' in its path, which would split the copied export command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
25e0c6080a |
filer: resume chunk reads where the last one ended (#13393)
* filer: resume chunk reads where the last one ended ChunkReadAt walked the chunk views from the front on every ReadAt, so reading a file of n chunks front to back took time proportional to n squared. S3 GETs (256 KiB reads) and WebDAV downloads (32 KiB reads) both read whole files through it: a 32 KiB read near the end of a file of 100,000 chunks took 164 µs instead of 8 µs. Keep where the last read ended and start the next walk there when it is at or before the new offset. The mount merges new chunks into a live reader's views, so the interval list now counts its edits and a kept position is only used while the count is unchanged. * filer: benchmark ChunkReadAt reads Whole-file sequential reads at 1 to 100,000 chunks, one-chunk files read with a new reader, and random reads, all served by mockChunkCache so they measure the reader itself. * filer: trim the resume-point comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Denis Maier <denis@dAir.lab> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e16d6c7b11 |
test: write failover read files until every volume server backs one (#13391)
TestReadWithVolumeServerDown wrote three files and required each volume server to hold a chunk of one of them. When the mount starts before the master is elected, the first writes can all land on the volumes one server lacks, and the test stopped before stopping anything. Write three more at a time, up to twelve, until every server backs a file. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5f252ef863 |
filer: preserve chunk timestamps during server-side copy (#13387)
* filer: reproduce overwritten bytes lost by server-side copy Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: retain chunk modification time during server-side copy Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: isolate the copy regression volume-location cache Signed-off-by: Perfloop Agent <agent@perfloop.ai> * filer: reuse fake master in chunk copy regression Signed-off-by: Perfloop Agent <agent@perfloop.ai> --------- Signed-off-by: Perfloop Agent <agent@perfloop.ai> |
||
|
|
7bfb5b6784 |
mount: take a live mount over without unmounting it (#13382)
* go.mod: take seaweedfs/go-fuse from #5 until it is released The handover builds on the server API of seaweedfs/go-fuse#5: Server.Stop, Start and Shutdown, Server.Dev and NewServerFromDev. Until that pull request is merged and tagged, go-fuse is replaced by its branch; the replace goes with the release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: quiesce the background writers, pause and resume the metadata subscription, and give a takeover its own cache directories The periodic metadata flush, the proactive chunk flush and the idle directory eviction check a gate before each tick, so a handover can stop them and wait for the work they run. PauseMetadataFollow and ResumeMetadataFollow end the subscription and start it again from the position of the last event it handled, with the filer.conf follower it had. A successor keeps the subscription's client id (the signature crosses), so it subscribes at an epoch above its predecessor's: the filer then replaces the old subscription instead of refusing the new one as a duplicate and making it wait for a retry. A process that takes a mount over (Option.Takeover) uses <id>.t<pid> for its read and swap directories, as the predecessor still uses <id>. A normal start removes the stale <id>.t* siblings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: the handover protocol, old side and new side A running mount listens on a unix socket (0600; the peer's uid is checked with SO_PEERCRED on both ends, ours or root). A successor connects, says hello, receives the FUSE fd with the INIT negotiation and the exported state, answers ready, and is told go. The hello carries the mount directory, the filer path and the options the state depends on (writeback cache, routed locks, nfs export): the running mount refuses a mismatch, a blocked lock request and a peer chunk server before it flushes or pauses. A connection closed before its hello is a probe (HandoverAnswers), logged at V(1). Until go the old side rolls back at every step (pre-flush, quiesce, stop, final flush, pause of the subscription, export, ready) and keeps serving: the subscription restarts from its position, the background writers and the nfs export writer resume, the server reads again. After go it closes its server without unmounting and marks itself committed, so its exit leaves the mount and the successor's sockets alone. The fd is carried by a fixed-size header written with one sendmsg and read with one recvmsg; control messages are length-prefixed JSON, and the state stream and the go frame are read through one bufio.Reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: a new mount on a live mount directory takes it over A weed mount started on a directory that is mounted already, whose weed mount answers on the handover socket, takes that mount over instead of replacing it: open files, locks and working directories inside it carry on. - Every Linux mount listens on a socket next to its local gRPC socket, <localSocket without .sock>.handover.sock, /tmp/seaweedfs-mount-<hash>.handover.sock by default; a deployment that keeps the local socket where the next mount process can reach it gets the same for this one. Not with -peer.enable, whose listen port has a single owner, nor with -filer.tokenFile, as read tokens and chunk proofs do not cross. - Those mounts read /dev/fuse in the stoppable way. - A new mount takes over when its directory is in the mount table and a process answers on the socket. When none answers (none runs, it crashed, it is an older weed), the mount proceeds as before. - A takeover skips the pre-mount unmount and the mount point check, binds the local gRPC socket and the handover socket only after the old process said go, and uses cache directories of its own. One that does not go through exits non-zero and leaves the running mount serving; to mount anew, stop that weed mount or unmount first, as for a busy mount today. - After go, a socket the new process cannot bind is logged, not fatal: the mount goes on without mount.configure or without a next handover, rather than going down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: end-to-end handover test test/fuse_handover starts a real weed mini and weed mount processes with the same arguments, and lets each new one take the live mount over, twice in a row and once more after a refusal. An appending writer, a streaming reader, an mmap, an unlinked temp file, an unclosed new file, a directory walk and a listing in progress, a held flock and POSIX lock, a process working inside the mount and a renamed open file run through it. It checks that the mount was never unmounted (mount id and st_dev), that the old processes exit 0, that a takeover refused because a SETLKW is blocked, or because the options differ, leaves the mount serving without a pause, and prints the pause. With HANDOVER_SCALE_FILES=<n> a second test creates n files, takes the mount over, and logs the pause and the size of the state. On a 2-vCPU VM: 10k files 18 ms and 360 KB, 100k files 134 ms and 2.9 MB, 300k files 410 ms and 7.1 MB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: answer the first review of the handover The checks before anything pauses: - The hello carries the filer addresses, sorted, and -defaultPermissions: the running mount refuses a successor of other filers (its open files and inode table name entries and chunks of this filer) or of another default_permissions (without it the kernel leaves the permission checks to the mount, and a successor that counts on the kernel would make none). - A successor finds the live mount for a relative -dir and for a path with a space: the mount table is read with the absolute path, and its octal escapes (\040 ...) are undone, which checkMountPointAvailable gets too. The local socket keeps its name. Rollback and commitment: - A rolled back handover starts the FUSE server first. A subscription that did not end in time may wait for a request to be served, and the rollback waited for it before the server read again. The subscription now starts again in the background once the old one has ended; until then a new handover is refused before anything pauses. - A successor reads the filer configuration (PrepareBackgroundTasks) before it connects, since a failure there after go would end the process with nobody serving the mount, and it does not create the mount root, which the running mount serves. - A reconnecting subscription publishes its epoch, so that a later one with the same client id starts above it instead of being refused as a duplicate. - A takeover's cache directories are <id>.t<pid>-<random>: two processes that each run as pid 1 of a container sharing the cache base got the same directory. Tests: - The protocol tests run on Linux only, as the protocol does; those of the background gate and of the cache directories run everywhere. - The end-to-end harness bounds the probes that go into the mount, waits until the SETLKW helper sleeps in FUSE before it asks for a takeover, counts only complete reader passes, closes the retained files on failure, rechecks a log after its process exited, and cleans up only mounts below its own directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: read the filer configuration again after a takeover A successor reads the filer configuration before it connects, so that nothing that can fail is left for after go. A change that the predecessor applied in between does not come again with the subscription, which starts where the predecessor stopped, and the successor kept the configuration it had read. It now reads it once more when it starts its background tasks; on failure the one read before stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: build the moved handover tests where their helpers are handover_quiesce_test.go uses newHandoverWFS, which is defined in a test file built everywhere but on Windows; it gets the same constraint. The mount readiness probe of the end-to-end test is also capped at the remaining deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: renew the routed lock leases before the background tasks wait on the filer A successor with -dlm holds the routed locks its predecessor took, and the filer drops their leases 15 s after the last renewal. StartBackgroundTasks began renewing only after it had read the filer configuration again, a filer call that can take longer than that. The renewal now starts first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: compare -readOnly and -allowOthers in the hello, and drop a filer configuration that is gone - -readOnly and -allowOthers are kernel mount options, fixed when the mount was made: a successor started with others would run with the old ones without knowing. The hello carries them and the running mount refuses a mismatch before anything pauses. - The filer configuration read again after a takeover clears the one read before when the file is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: close the held lock files of the handover workload on failure The flock and POSIX lock files are opened before the takeovers and closed in finish(); an assertion that fails in between left them open. They get a cleanup right after they open, like the other retained files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: compare the kernel's mount options as -o sets them too, and retry the filer configuration read after a takeover - allow_other, ro and default_permissions can come from -o as well as from their flags. The hello compared the flags only, so a successor started with -allowOthers=false could take over a mount made with -o allow_other. The mount now records the kernel's options from both (KernelReadOnly, KernelAllowOther, KernelDefaultPermissions), and the hello compares those. - The read of the filer configuration after a takeover is tried three times before the subscription starts, which can wait: it starts where the predecessor stopped. Only if all fail does the configuration read before the takeover stay until its next change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drop the WEED_MOUNT_HANDOVER_STOP_TIMEOUT test hook The drain bound stays at its 10 s default; the end-to-end tests wait well over that for a refusal, so they do not need a setting of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: close a descriptor that comes with a refused handover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: take a mount over when the new process shares a filer with it The hello required the sorted -filer list to match exactly, so a successor started after filers were added to the cluster or taken out of it was refused, and the old mount kept serving. A filer serves one filer store: one filer in common means the store that the open files, the inode table and the chunks belong to. Compare the filers as host:port, as ServerAddress.Equals does, so that an address written with its gRPC port counts as the same filer, and refuse only lists with no filer in common. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: run the FUSE mount handover end-to-end tests test/fuse_handover starts a real weed mini and weed mount processes and lets each new mount take the live one over; no workflow ran it, so only the unit tests guarded the handover in CI. The job follows the FUSE DLM one: it repairs the fusermount3 setuid bit, builds weed and runs the tests with WEED_BINARY. The tests mount as the runner user without allow_other, so fuse.conf is left alone. A failed run uploads the weed logs, which the harness keeps in /tmp/fuse_handover_*. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: compare the kernel's mount flags in the hello, resolved in order The hello compared ro as "-readOnly or -o ro", and no other mount flag. -readOnly puts ro before the -o options, and both fusermount3 and go-fuse's direct mount apply the options in order, so -readOnly with -o rw mounts read-write while the hello said ro. A successor started with -o noexec, nosuid or nodev also got the old mount's flags without knowing. Resolve the generic flags from the option list go-fuse mounts with, in order, from nosuid and nodev as both mount paths start, and refuse a successor whose flags differ before anything pauses. relatime is left out: the kernel uses it unless noatime or strictatime is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: do not send a handover control frame the peer would refuse writeControl sized its buffer from the encoded message without a bound, while readControl refuses a frame over maxControlFrame. Refuse the larger frame before allocating, as the reading side does (CodeQL go/allocation-size-overflow). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: unmount the handover e2e mounts with fusermount when fusermount3 is missing The harness detached leftover mounts with fusermount3 only. A fuse2 host, such as CentOS 7 or an Alpine image with the fuse package, has only fusermount, so the last step of TestHandoverEndToEnd failed there after every handover had passed. Try fusermount3, then fusermount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * go.mod: use go-fuse v2.9.6 instead of the branch of seaweedfs/go-fuse#5 seaweedfs/go-fuse#5 is merged and tagged v2.9.6, whose tree is the one this pull request was tested with (1eec9a8). Drop the replace with the fork and require the release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: whitebear009 <whitebear009@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
91caa97b8e |
filer: answer forwarded creates, updates and deletes after replaying them (#13406)
* filer: answer a forwarded create or update after replaying it A conditional or exclusive create, or a conditional update, is forwarded to the entry's write owner and stored there first. When the owner keeps a store of its own, the forwarding filer sees the write only once it replays the owner's event, so the caller's next lookup through it could find the file missing or stale: a mount reopening the file it just closed got ENOENT. Wait for that replay before answering, as a forwarded rename already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: answer a forwarded delete after replaying it A delete forwarded to the write owner removes the entry there first; until this filer replays the owner's event, a lookup through it still finds the entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: skip the replay wait for an owner on this filer's store An owner that runs on this filer's store wrote the entry there already, so waiting for its event to replay only delays the answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c3e284a45c |
s3api: return SSE headers from CompleteMultipartUpload (#13389)
* s3api: return the object's SSE headers from CompleteMultipartUpload AWS answers CompleteMultipartUpload for an encrypted object with x-amz-server-side-encryption, the KMS key id and bucket-key-enabled. Read them from the committed entry the way HEAD does, on both the first answer and a retry answered from the committed object. SSE-C customer headers are not echoed, as AWS does not send them on Complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: test CompleteMultipartUpload SSE response headers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: answer CompleteMultipartUpload SSE headers from the entry only setSSEResponseHeaders falls back to the request's KMS key id and bucket-key headers, so a Complete request carrying them could report a bucket key the object does not use. Complete's own headers say nothing about the object; pass none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: test that Complete does not echo request SSE-KMS headers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
da62513b3e |
s3api: return SSE headers from CreateMultipartUpload and honor its encryption context (#13388)
* s3api: return the upload's SSE headers from CreateMultipartUpload CreateMultipartUpload now answers with the encryption the upload was initiated with, as AWS does: x-amz-server-side-encryption for SSE-S3 and SSE-KMS, the KMS key id, encryption context and bucket-key flag, and the SSE-C algorithm and key MD5. Bucket-default encryption is reported the same way, from the config stored on the upload entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: validate the SSE-C key and KMS context on CreateMultipartUpload Initiate accepted an SSE-C key whose MD5 did not match, an incomplete SSE-C header set, and a KMS encryption context that was not base64 JSON, then created the upload. Reject them before creating the upload with the same codes PutObject returns, so the headers the response echoes are ones the parts can use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: encrypt multipart parts with the context given at initiate CreateMultipartUpload stores the x-amz-server-side-encryption-context header as received, base64 JSON, but UploadPart and UploadPartCopy parsed it as raw JSON, failed, and fell back to the default context. Every part's data key was wrapped without the context the client asked for. Parse the stored value the way the header is parsed on PutObject. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: reject KMS encryption contexts the key service refuses up front CreateMultipartUpload accepted a context with control characters, a whitespace-only key or too many pairs, so every part then failed; PutObject answered the same input with a 500. Both now build the merged context once and apply the KMS checks, answering InvalidRequest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: keep the derived aws:s3:arn in a client's KMS encryption context A context header naming aws:s3:arn replaced the object or bucket ARN sent to the key service, on PutObject and, through the context stored at initiate, on every multipart part, so a key policy conditioned on aws:s3:arn could be met with another bucket's ARN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7ead5e4e23 |
filer: persist the metadata log as soon as shutdown starts (#13386)
The shutdown leaves the lock ring and drains gRPC and HTTP before Filer.Shutdown runs the final metadata log flush. Those steps can take longer than a container's termination grace period, and a kill before the final flush drops every local event since the last periodic flush. On a shared store peers keep those events only in memory, so they vanish from every filer's aggregated stream. Start a flush of the local metadata log first, in the background, so the events accepted before the signal are persisted within seconds. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ac12fc4683 |
helm: bump COSI driver to v0.5.0 (#13375)
The chart default was still v0.1.2 from September 2024. Co-authored-by: Claude Mythos 5.2 <noreply@anthropic.com> |
||
|
|
0b7bd23647 |
s3api: stop at startup when the -s3.config KMS block doesn't load (#13380)
* s3api: stop at startup when the -s3.config KMS block doesn't load A kms block in the -s3.config file that failed to load was only logged, so S3 came up healthy with SSE-KMS off. Every SSE-KMS write and every read of an SSE-KMS object then failed with 500, and nothing at startup pointed at the config. loadS3ApiConfigurationFromFile now returns the KMS error once it has applied the identities, and startup already stops on any error it returns. A SIGHUP reload still applies the identities, so a revoked key stops working, keeps the previous KMS providers and logs the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: shorten the KMS load-order comment 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> |
||
|
|
b69076476b |
s3api: return KMS errors on SSE-KMS writes as their S3 error codes (#13379)
* s3api: return KMS errors on SSE-KMS writes as their S3 error codes An SSE-KMS PutObject, UploadPart, UploadPartCopy or CopyObject naming a key the KMS doesn't have failed with 500 InternalError, and so did a plain upload to a bucket whose default encryption names one. MapKMSErrorToS3Error never saw these errors. The put path returned InternalError for every encryption failure. The copy path compared the mapper's result against InvalidRequest, which it never returns, so it answered InternalError for every error and its SSE-C check after it never ran. And the KMS calls wrapped the provider's error with %v, so its type was gone before any of them looked. Wrap the provider errors with %w, find the KMS error with errors.As, and map encryption failures on the put path, the bucket default put and the inline copy path. A missing key is now 400 KMSKeyNotFoundException, a disabled one 400 KMSKeyDisabledException, and errors that don't come from KMS stay 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: map wrapped SSE-C errors to their S3 codes A destination SSE-C parse error reaches the copy error mapper wrapped with %w, so the exact-match switch missed it and the copy answered 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3err: answer KMS key errors with the codes AWS S3 uses AWS S3 reports a missing SSE-KMS key as KMS.NotFoundException, a disabled one as KMS.DisabledException, and a denied KMS call as AccessDenied. 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> |
||
|
|
731431af72 |
export: fail tar exports on unreadable live needle bodies (#13377)
* export: fail the tar export on an unreadable live needle * export: honor -newer after needle body read errors Skip a damaged record when its decoded modification time excludes it from the tar. Publish the date flag only after decoding the timestamp so incomplete metadata still fails the export. * needle: keep reading a record whose fields end before its timestamp The last-modified field was decoded without the length check the other optional fields keep, so a record whose bytes end right after its flags, name or mime now failed as corrupted. Older reads, and the Rust volume server, read it without a timestamp. Keep the check; the flag stays off until the timestamp is decoded. 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> |
||
|
|
d6c2662da5 |
filer.copy: continue after a failed file and return a nonzero batch status (#13381)
* filer.copy: finish the batch and report failed copies * filer.copy: test cleanup after mixed chunk upload outcomes * filer.copy: check the refused uploads reach the volume in the batch test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer.copy: drop the trailing newline from entry creation errors Each copy error is now printed on its own line, so the embedded newline left a blank line after it. 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> |
||
|
|
940ecedbfb |
perf(iceberg): list each catalog dir once per scan (#13383)
* iceberg: list each catalog dir once per scan The maintenance scan already lists every namespace of a bucket; it now gathers the catalog roots from those entries instead of listing them all again through CatalogRecordRoots (3 listings per directory -> 1). Live stage-creates are still read, only when a table needs the check. A namespace filter, or a bucket over 10000 table entries, keeps the old path. A namespace that cannot be listed skips the bucket for the pass; removeOrphans still rechecks before deleting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * iceberg: reuse listed namespaces past the gather cap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * iceberg: keep no stages from a failed read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3tables: describe the moving root as the one a record moves to ExtendedKeyMoving holds the metadata an update is about to write, so the extra root is the destination, not the one the record leaves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * iceberg: trim the scan's 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> |
||
|
|
0860fa3f07 |
volume: skip the full .idx walk on restart for leveldb and redb indexes (#13384)
* volume: count leveldb writes only once the .idx row lands A Put or Delete whose .idx append failed still bumped the file and deletion counters, so they drifted from what a recount of .idx gives. The redb map already counts after the write succeeds. * volume: track the largest needle end on leveldb and redb writes Only the load walk set it, so it went stale as soon as a volume took writes. Keep it current so it can be carried across a restart. * volume: save needle counters on close instead of recounting .idx on load Every load walked the whole .idx to rebuild the file and deletion counters, which dominates restart time on servers with large indexes. A clean close now stores them in the .ldb / .rdb tagged with the .idx size (and mtime on Go) they describe; the next load takes them and deletes them, so a crash or an .idx changed while closed falls back to the full walk. * volume: save no counters while .idx holds a partial row A failed append can leave bytes past the last whole row that the counters never saw. Tagging the counters with that size let the next open take them and append from a misaligned offset. * volume: prove reopen takes the saved counters, not a recount A recount gives the same numbers, so the tests passed even when close saved nothing. Skew the saved file count and expect it back. * volume: test saved counters dropped when only the .idx mtime changed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
24529a3c8b |
sftp: keep a grown file's hole out of the temp file and the upload (#13374)
* sftp: copy only the stored bytes on a non-truncating open A size set by a truncate that grows a file stores nothing, but opening the file for writing without O_TRUNC copied its whole logical size into the temp file as zeros. Copy up to the last stored byte and extend the temp file to the size, which leaves the rest sparse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: upload only up to the written data on close Close streamed the whole temp file, so a hole after the data, from a truncate that grew the file before or during the open, was read back and uploaded as zeros. Track where the copied and written bytes end, upload up to there, and keep the rest as the file's size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: leave the data end alone on an empty write A zero-length WRITE far past the data moved the data end there, so Close uploaded the hole before it as zeros. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: cap what the test filer reads from an upload An upload that wrongly carries a large hole now fails the test instead of filling memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: hash nothing past an out-of-range size A stored size past the largest file offset turned negative and sliced the inline content out of range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: refuse a setstat size past the largest file offset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: fail the hash of an out-of-range size Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: check the size before returning a stored md5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |