* mount: let SEEK_DATA and SEEK_HOLE see data that is not in the chunks
Lseek searched only the file's uploaded chunks. Writes not uploaded yet,
inline content and the data of a remote file that is not cached are not
in them, so for such a file SEEK_DATA answered ENXIO and SEEK_HOLE found
a hole at the offset. A program that copies by data ranges, such as
qemu-img, takes the data for a hole and writes zeros in its place.
A file whose data is not all in its chunks is now answered as one data
range without holes, as lseek(2) allows: SEEK_DATA returns the offset and
SEEK_HOLE the end of the file. The upload pipeline attaches a chunk
before it counts the upload as done, and writes hold the handle lock
that lseek shares, so a file with no pending upload has all its written
data in its chunks.
Lseek also read the file size without the entry lock, while upload
workers append chunks under it. It now holds the lock for that read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: answer lseek from the chunks of a cached remote file
A remote file keeps its RemoteEntry once cached, so checking only for
RemoteEntry reported every such file as one data range. Use
IsInRemoteOnly, as Read does, so the holes of a cached file are found.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: trim the lseek 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>
* mount: drop a directory's listing when the cache refuses an entry update
UpdateEntry and UpdateEntryChecked returned the store's error and left
the entry in the local store as it was. The mount uses them to refresh
the other names of a hard-linked file after a link or an unlink
(syncHardLinkSiblings), which only logged the error at V(4). With a full
cache disk the siblings kept their old link count and ctime until their
directory was read again.
A refused update now drops the listing of the entry's directory, as
dropListingsOf does for an event the store cannot take (#13141), so the
next lookup there goes to the filer. The listing is dropped after the
cache lock is released, as dropListingsOf does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mount: shut the meta caches of the refused update test down
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docker: one FIPS mode for the Go processes and the Rust binaries
In the image, Go processes ran with fips140=on by default (#7590) while the
Rust binaries, which take their mode from fips.mode alone, ran with
unrestricted TLS; and WEED_FIPS_MODE=off or strict made every Go process
refuse to start, since the entrypoint's fips140=on did not match.
The entrypoint now states the image's mode once, as
WEED_FIPS_MODE_DEFAULT=on, and gives Go processes the fips140 GODEBUG that
matches WEED_FIPS_MODE, else that default. The Rust binaries use the
default when neither WEED_FIPS_MODE nor fips.mode sets a mode; Go processes
check their GODEBUG against it and refuse to start on a mismatch, naming
WEED_FIPS_MODE as the way to pick another mode. Setting
WEED_FIPS_MODE_DEFAULT empty leaves every process in its own default, as
outside the image.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docker: take the image's FIPS mode from a fips140 the caller sets
GODEBUG=fips140=off, the entrypoint's advice since #7590, made every Go
process exit once the Rust binaries joined the image's mode. The entrypoint
now maps the caller's fips140 to WEED_FIPS_MODE_DEFAULT, so Go and Rust run
in that mode and the old advice keeps working.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docker: say fips.mode alone cannot change the image's FIPS mode
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docker: read an empty fips140 as off and debug as on, as Go does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docker: warn when GODEBUG fips140 picks the image's FIPS mode
The entrypoint keeps translating a caller's fips140 into the mode for the
Rust binaries, so existing docker run setups keep starting, but logs that
WEED_FIPS_MODE is the setting that also covers launches without the
entrypoint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docker: set the FIPS mode after dropping privileges
Running as root, the entrypoint re-runs itself through su-exec, and the
second pass took the fips140 the first pass had exported for the caller's
own, warning on default starts and prepending fips140 twice.
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>
* test/s3: FsMkdir no longer fails on its own in the rclone fstests
expected_failures.txt listed the test itself because DeleteBucket answered
BucketNotEmpty at the end of the run. Since #13311 a null delete marker can
be deleted, the bucket ends up empty, and the check has failed on master and
on every pull request the workflow runs for:
TestIntegration/FsMkdir: now fails only through its subtests, remove it
from expected_failures.txt
* filer/hbase: propagate errors when deleting directory children
* filer: reclaim HBase chunks after each confirmed row deletion
* filer: return a child's remote delete error from a recursive delete
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: drop the per-row folder delete store capability
Keep the HBase scan and row-delete errors reaching the caller without a
new FilerStore capability. A store that fails partway through
DeleteFolderChildren leaves already-removed rows' chunks to volume.fsck,
as every non-transactional store already does.
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>
* kms/local: resolve key and alias ARNs
AWS KMS takes a key's or an alias's ARN wherever it takes a key ID or an
alias, and the local provider hands out ARNs in DescribeKey, but it looked
them up as plain names, so an ARN named no key. A local ARN now resolves to
the key or alias it names, in requests, in the keys list's key_id and
aliases, and in CreateKey's aliases. An ARN with an empty key ID names no
key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: register a key created by ARN under its key ID
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: refuse a key ARN listed as an alias
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: refuse a key ID that is an ARN of an ARN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: resolve a key ARN only to the key with that ID
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: create an on-demand key under the ID its ARN names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: decrypt keeps the key ARN a ciphertext was wrapped under
A key configured by its ARN had that ARN as its ID before key ARNs
resolved, and S3 stored it with each object and compares it with the
ID Decrypt returns.
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>
* kms: take the default provider from the config being loaded
S3 wraps and unwraps data keys with the default provider alone. Without
default_provider, the loader made the first provider the manager listed
the global one, and the manager still holds the providers earlier loads
listed, so a reload could leave S3 on a provider the config dropped. The
manager's own default, which buckets without a mapping use, was left
unset. The default is now the first provider by name in the config being
loaded, for both. A default_provider that isn't listed under providers
fails the load before any provider changes, where before it could name a
provider left over from an earlier load. With more than one provider and
no default_provider the load logs a warning, as adding a provider whose
name sorts first would switch S3 to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms: load the default provider first and fail the load if it can't be loaded
A load whose default provider failed replaced and closed the other providers first, so S3
could be left on a closed instance of one of them as the global provider.
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>
* s3api: refuse a directory marker PUT when the existing marker cannot be read
Only a missing marker skips the Object Lock check. Any other lookup
error now fails the request instead of letting mkdir replace a marker
that may be under retention or legal hold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: create the Extended map before applying upload ACL metadata
A directory extracted from a zip without an owner header reached
applyPutObjectACL with a nil Extended map and panicked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: refuse extracting over a marker that cannot be read
The zip extract mkdir path had the same fail-open lookup as the
directory marker PUT; a failed read now reports InternalError for the
member.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: limit service account keys to their stored actions
A service account created with an action subset authenticated as its
parent and was authorized with the parent's full permissions. Map each
restricted service account key to a copy of the parent that carries the
subset as a boundary, and check it in the S3, bucket listing and IAM
authorization paths. An empty action list still inherits the parent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: drop restricted service account keys with their removed parent
RemoveIdentity only dropped keys that mapped to the parent itself, so a
restricted service account key, which maps to its own bounded copy, kept
authenticating after the parent was deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sts: keep restricted service account keys out of their parent's roles
A named role is admitted by its trust policy alone, so a service account
key limited to Read could assume any role trusting its parent and use the
role's permissions. Require the key's action subset to allow
sts:AssumeRole.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: let a service account's scoped upload listing grant pass its boundary
The upload and part listing routes are authorized as Read, and the
legacy path falls back to the listing grant. The boundary check now does
the same, so a service account limited to ListBucketMultipartUploads can
still list uploads without being allowed object reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sts: refuse self sessions for restricted service account keys
AssumeRole without a RoleArn and GetFederationToken issue sessions that
carry the caller's own policies, which for a service account are its
parent's. A restricted key would shed its action subset that way, so
refuse both for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sts: give the restricted service account role test its own role
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: check a restricted key's parent grants apart from its boundary
The boundary is checked against the request first, so the legacy action
check only has to cover the parent's grants. Checking the boundary there
again without the request denied a Read parent's upload listing to a key
limited to ListBucketMultipartUploads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
TestALeadThatLostItsLockDoesNotSend dropped the forwarder lock on the
first fetch of any partition, then waited for a fetch of partition 0.
When another partition's goroutine fetched first, the lead stopped before
partition 0 was fetched and the wait timed out (seen on the 32-bit job).
The hook now gets the request and drops the lock on partition 0's fetch.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* operation: resend an upload that hits a broken pipe on a stale connection
A pooled connection the server has closed fails an upload in one of three
ways, depending on when the close reaches the client. Two of them, a reset
and a closed connection, already get the request resent once with its body
rewound. A broken pipe did not.
A volume server closes a connection idle for 30 seconds and the client keeps
idle ones for 90, so a request that reuses a connection as it turns 30 seconds
old races with the close. The forward of a write to a replica makes a single
attempt: there the write failed with a 500, and the needle already stored on
the primary stayed on that one replica.
* seaweed-volume: resend a replica forward that hits a reset on a stale connection
The Rust replica forward made one attempt, so a pooled connection the peer
closed at its idle timeout failed the write with a broken pipe or a reset,
as the Go forward did before. Resend it once on a new connection, as Go's
upload_content does.
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>
The recursiveListDeclined sync.Map placed ahead of inFlightDataSize and
inFlightUploads moved them off 8-byte alignment on 386, so the first
throttled upload panicked with "unaligned 64-bit atomic operation".
atomic.Int64 is aligned wherever it sits in the struct.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* master: start file ids past the ones a previous master may have handed out
The file id sequence lives in memory. A master that starts, or takes over
as leader, continues it from what the volume servers report: the largest
needle id each of them holds. That is the largest id written, not the
largest one handed out, so the ids of uploads that had not landed when the
previous master was lost are handed out a second time.
Two uploads then hold one needle id in one volume with different cookies.
The one that lands second is refused, and deleting its file id, which goes
by needle id, removes the needle of the other: a file the filer had
answered 201 for lost its chunk on every replica that way.
A volume server's first report to a master now sets the sequence past its
largest needle id by a margin instead of right after it. Later reports
count as before, and a server that holds nothing adds no margin.
* master: shorten the unwritten file id margin comments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: record the file ids handed out through raft
Starting a margin past a volume server's first report does not hold for
two masters lost in a row: with nothing written in between, the second one
gets the same report and hands out the same id.
The master now records through raft how far it may hand file ids out
before it does (MaxVolumeIdCommand.FileIdCeiling, a step of 2^20 ids at a
time), and every master moves its sequence past what another one recorded,
from the log or from a snapshot. An id goes out only when it was drawn
under a ceiling this master recorded itself: recording one applies what
the masters before recorded first, so an id drawn after that is past all
of theirs, and one drawn before it is dropped.
A master that does not know the field ignores it. Snowflake ids are made
from the clock and are left alone.
* master: leave room for a file id draw larger than the ceiling step
A draw of more ids than fileIdCeilingStep never fit under the ceiling
recorded after it, so the assignment kept recording ceilings through raft.
The record now covers the dropped draw and the next one, and a count past
2^32 is refused before the additions can wrap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: tell a recorded file id ceiling apart from another master's
A master that took over could propose the same ceiling the one before it
recorded and it had not applied yet. Applying that entry then looked like
applying its own, so its sequence stayed below ids the other master had
handed out. Each record now carries an id of the master process, and only
an entry with that id and value leaves the sequence where it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: charge assigned bytes only once the file id is recorded
An assignment that failed to record its file ids kept the bytes charged to
the volume, which could mark a volume near its limit full for an upload
that never came.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: move the sequence before publishing a file id ceiling
An assignment that loaded a ceiling another master recorded, before the
sequence had moved past it, could draw an id below it when this master had
proposed the same value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: test that a failed file id record charges the volume nothing
The order c40e01786 set. Before it, an assignment that could not record its
file ids left the volume charged for them: 1 MB for an id never handed out.
* sequence: stop the memory sequencer at the largest file id instead of wrapping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: refuse a file id draw whose ceiling would wrap past the largest id
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>
* filer: continue prefix listings on unordered stores
* test/s3: FsMkdir no longer fails on its own in the rclone fstests
expected_failures.txt listed the test itself because DeleteBucket answered
BucketNotEmpty at the end of the run. Since #13311 a null delete marker can
be deleted, the bucket ends up empty, and the check has failed on master and
on every pull request the workflow runs for:
TestIntegration/FsMkdir: now fails only through its subtests, remove it
from expected_failures.txt
(cherry picked from commit b248167800)
* filer: read unordered stores in full pages when filtering a prefix
An unordered store can have to be read to its end for a prefix, and
reading it in pages of the caller's limit (max-keys + 2 for S3) turned
one listing into a store query per few entries.
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>
expected_failures.txt listed the test itself because DeleteBucket answered
BucketNotEmpty at the end of the run. Since #13311 a null delete marker can
be deleted, the bucket ends up empty, and the check has failed on master and
on every pull request the workflow runs for:
TestIntegration/FsMkdir: now fails only through its subtests, remove it
from expected_failures.txt
Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com>
Interim merge note (spec trace workflow startup_failure since 22:45Z): docs-only change to the v1.1 release notes on release-1.1 (known limitation 7). go test (linux) and process-level tests (real binaries) passed on a07cebc3; spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts against this head and body (base release-1.1 at 4187ddaf): both pass. Docs review ACCEPT on a07cebc3 (accuracy and public text: no findings).
Interim merge note (spec trace workflow startup_failure since 22:45Z): docs-only change to the v1.1 release notes on release-1.1. go test (linux) and process-level tests (real binaries) passed on bc83e995; spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts against this head and body (base release-1.1 at a6304c21): both pass. Docs review ACCEPT on bc83e995 (accuracy and public text: no findings).
Interim merge note (spec trace workflow startup_failure on all branches since 22:45Z): branch updated to current main (69c5c6bd); go test (linux) and process-level tests (real binaries) passed on 69c5c6bd; spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts against this head and body: both pass (Model line now also cites FormatGate.Report for core/host/master/services.go, mapped since the PR was accepted). Code review ACCEPT on e1ed5073; the 1 TiB loaded first-cut measurement on current main passed on both volume formats.
Interim merge note (spec trace workflow startup_failure on all branches since 22:45Z): go test (linux) and process-level tests (real binaries) passed on cc3a8a6c (run 46997615891); spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts against this head and body: both pass. Code review ACCEPT 6161155789; model review ACCEPT 6161515202 (per-call read/trace follow-up recorded there).
Interim merge note (spec trace workflow startup_failure on all branches since 22:45Z): go test (linux) and process-level tests passed on 7ae34a7e; spec-trace-check.sh and public-text-check.sh run locally against this PR's body and diff on main af07f8be: both pass.
* sftp: create uploaded files with mode 0644
The upload writer carried a 0644 mode that never reached the filer, so the
PUT fell back to the filer default of 0660. Pass the mode on the PUT, as
OpenSSH's sftp-server creates new files 0666 minus a 022 umask.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: keep an existing file's mode when an upload overwrites it
An overwrite went through the same PUT as a new file, so a 0600 file came
back with the default mode. Send the stored mode instead, as open(2) on an
existing file keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: apply an fsetstat sent while an upload is still buffering
"put -p" sets the mode and times on the open handle before closing it, but
the upload only reaches the filer on close, so the setstat found no entry and
the client failed with "No such file or directory". Keep such attributes on
the open upload: a size cuts the buffered bytes, the mode goes on the PUT,
and the rest is set once the file is stored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: clear the sub-second part of an mtime a setstat replaces
SFTP times are whole seconds, but the stored nanoseconds of the old mtime
stayed, so a touched or "put -p" file showed a time the client never set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: set the attributes queued on an upload in its post-upload update
A new file can be under its bucket's default retention as soon as the PUT
stores it, and a setstat after that is refused, so "put -p" into such a
bucket stored the file and then failed the close. Apply the queued
attributes in the update that already sets the owner after the upload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: leave a setstat alone when two uploads share its path
A setstat carries only the path, so with two uploads of one path open in a
session it went to whichever opened last, and a size cut the other upload's
bytes. Route it to an upload only when that upload is the only one open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: fail the close when an upload's queued attributes are not stored
The setstat already answered success, so a failed post-upload update was
only logged and "put -p" lost the times without the client knowing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* shell: volume.fsck says how many chunks its cutoff left out of the missing-chunk check
volume.fsck -findMissingChunksInFiler leaves out every filer chunk written
within -cutoffTimeAgo, five hours by default, and did not say so. Run after
volume servers lost power, it found nothing missing for exactly the files
at risk: the ones written last.
The check now counts the chunks it leaves out for the cutoff and ends with
one line that gives the number and points at -cutoffTimeAgo. The default
cutoff stays, and the orphan check is not touched.
* shell: volume.fsck counts only the chunks its run would have checked
The walk reads the whole filer, so a recent chunk on a volume that
-volumeId or -collection left out of the run was counted too, and the
report said a shorter cutoff would check it. Count a chunk only when its
volume is one of the run's, or one the master does not list and -volumeId
does not leave out, which is what the check itself looks at.
* shell: volume.fsck applies -modifyTimeAgo before counting chunks the cutoff left out
A chunk older than -modifyTimeAgo is not checked at any cutoff, so it
does not belong in the count a shorter -cutoffTimeAgo would check.
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>
* filer: delete the chunks a failed copy wrote
A copy through the filer (POST dst?cp.from=src) writes the destination's
chunks first and its entry last. When it ended before the entry was written
(the client gave up, a chunk failed to copy, the entry write failed), the
chunks already on the volume servers stayed there, with no entry to
reference them and nothing to delete them.
The fan-out now waits for the copies it started, starts no further one
after a failure or once the request has ended, and deletes what the
completed ones wrote. A chunk copy that fails deletes the file id it was
assigned, as a failed write can still have stored the needle. A failed
entry write deletes only the chunks the destination does not hold, since
CreateEntry can fail after storing the entry.
#13217 did the same for the S3 copy paths.
* filer: keep the copied chunks when the entry write fails
CreateEntry can fail after it stored the entry: the entry stays when only
its parent folders could not be created. Reading the destination afterwards
does not settle whether the chunks are live, since an entry that was stored
may have been renamed by then, and deleting on a miss would take its data.
So a failed entry write keeps the chunks, as it did before. Only the
failures that come before the entry write delete what the copy wrote.
* filer: fail a copy whose request ended after its last chunk
A request cancelled once every chunk copy had returned still handed the
chunks on, to an entry write that the cancelled context then fails, and
that write keeps them. The end of the request now fails the fan-out
whether or not a copy was left to start, so the chunks are deleted there.
---------
Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com>
* volume.check.disk: resurrect needles a vacuumed replica provably never had
-resurrectMissingNeedles copies a needle that is live on one replica and
absent on the other only into a replica that was never vacuumed: a vacuum
erases deleted needles together with their delete markers, so on a
vacuumed replica an absent needle may be a delete. Once every replica has
been vacuumed, a replica that lost writes, the tail of its volume after a
crash for one, has no repair but copying the whole volume.
A vacuum erases only among the needles the index holds when it commits.
The volume now records the largest needle id it held then, deleted ones
included, in its .vif (VolumeInfo.vacuumed_max_file_key), before the
vacuumed files replace the old ones. A needle with a larger id that the
replica has no index entry for was never deleted there, since no vacuum
has touched its marker: it was never written there. volume.check.disk
-resurrectMissingNeedles reads the record with the compaction revision
and copies such needles back; absent needles up to the recorded id are
left alone as before.
The record is only good if no vacuum went unrecorded, so it starts at a
volume's first vacuum and is kept through each one after it. A volume
vacuumed before it had a record never gets one and keeps the present
rule. A copy of a volume takes the record along in the .vif.
* volume.check.disk: look at vacuumed replicas whose live counts match, and judge only what stays unrepaired
Two replicas at different compaction revisions with equal live counts were
skipped under -resurrectMissingNeedles when both had been vacuumed, since
neither could take a needle back. One that recorded its vacuums can, and a
missed write plus a missed delete leave the live counts equal. Under the
flag such a pair is now compared.
A run without -apply ends with a verdict on the needles one replica has
and the other lacks. It counted the ones the run would have resurrected
with -apply, so two replicas each missing needles above the other's
recorded id were called a split brain not to be repaired. Needles above
the recorded id of the replica lacking them are left out of the verdict.
* volume: trust the vacuum record only at the revision it was written for
A vacuum by a volume server that does not keep vacuumed_max_file_key (an
older Go one, or the Rust one) erases delete markers above the record but
leaves the .vif as it was. Once a server that reads the record serves the
volume again, volume.check.disk -resurrectMissingNeedles takes those ids
for missing writes and raises deleted needles.
The record now names the compaction revision its vacuum produced. It is
saved after the swap, so a vacuum that fails to record it leaves a
revision that no longer matches, and check.disk and later vacuums only
take it up while it equals the volume's live revision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: number the vacuum record fields 12 and 13
VolumeInfo 10 and 11 already carry other bool fields in a downstream
build. A volume server of that build answering ReadVolumeFileStatus would
read here as vacuumed_max_file_key 1 at revision 1, a record that lets
check.disk resurrect every absent needle. The .vif is keyed by name, so
only the wire numbers move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): record the largest needle id a vacuum could have erased
Mirror the Go volume server: VolumeInfo carries vacuumed_max_file_key and
the compaction revision it was taken at (fields 12 and 13). commit_compact
keeps the record through every vacuum once the volume has one, saves it
after the swap, and drops it once a vacuum went unrecorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): keep the ids of cut tail needles in the decoded index
The EC decoder dropped the .idx row of a deleted needle past the decoded
.dat, so the compaction that follows recorded a vacuumed max needle id
below it. volume.check.disk -resurrectMissingNeedles could then copy that
deleted needle back from a stale replica. Write the row as a tombstone
without the offset instead, as Go keeps every .ecx row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): count tombstone keys toward the max file key on redb loads
metrics_from_idx skipped the max-key update for tombstone rows, unlike
Go's needleMapMetricFromIndexFile and the in-memory replay. A deleted
tail needle then left a redb volume's vacuum record below its id.
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>
* s3api: list a versioned key whose .versions folder streams past the page
A key's .versions folder sorts after the longer keys it prefixes:
"a.pom.versions" follows "a.pom.sha1.versions" although the key
"a.pom" sorts before "a.pom.sha1". A ListObjects page that filled in
between returned the longer key and resumed past the folder name, so
the shorter key was never listed.
When a versioned page is truncated, look up the .versions folder of
each proper prefix of the page's last item that would still stream
after it, add the live keys found, drop as many items off the end,
and resume from the last key kept instead of a .versions folder name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: test versioned listing pages that end between a key and its .versions folder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: test encoded versioned listing pages with spaces and plus signs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: keep recovered versioned keys in raw key order
Encoded keys do not sort like raw ones ("a%20b-1/x" before "a+b"), so
a key recovered past the page boundary is placed by its raw key before
the page is trimmed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: order a versioned page by raw key when listing with encoding-type=url
The in-page insert compared encoded keys, which sort differently from
raw ones once a directory and a file name escape a space differently.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: test encoded directory keys at a versioned page boundary
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: scan raw keys when retracting a delete-marked null object
The page is now ordered by raw key, so the backward scan that finds the
null object to retract stops on raw keys too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: split the .versions file delete out of deleteSpecificObjectVersion
deleteVersionFile deletes a version stored under .versions and repoints
the latest pointer past it. deleteSpecificObjectVersion keeps "null" as
the plain object entry, which the suspended delete and lifecycle paths
rely on, and calls deleteVersionFile for every other version id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: delete a null delete marker named by versionId=null
A suspended-versioning delete stores its marker as .versions/v_null, but
DELETE ?versionId=null only looked at the plain object entry. With no
null object there, it answered 204 without x-amz-delete-marker and left
the marker in place, so the bucket could never be emptied.
When the plain null object is missing and a null marker exists, delete
the marker file and repoint the latest pointer to the prior version.
The routed specific-version delete leaves that case to the lock path,
which already handles batch deletes the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: order the repoint past a deleted null delete marker by the versions left
A null delete marker's id has no format, so the routed version delete
read the recompute order from the first remaining version file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: delete a null delete marker on the key's owner
The marker is read from the owner, so deleting it through the gateway's
own filer could answer success while the owner kept it. Both the routed
DELETE and the lock path delete it with a routed transaction instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: rank the versions left by time when deleting a null delete marker
Mixed legacy and inverted ids made the first file name a wrong guide to
the repoint order. The routed delete now finds the newest remaining
version and picks the name order that reaches it; when neither end of
the order is the newest, it leaves the delete to the lock path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: keep only the ends and the newest while scanning for the null marker repoint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: choose the null marker repoint from the owner's own listing
A filer other than the key's owner can lag it, and the recompute runs over
the owner's full directory, so a direction picked from a replica's partial
listing could repoint the object to an older version. Scan .versions on the
owner only; when the owner cannot answer, leave the delete to the lock path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* kms: read filer.toml and the identities file with one parser
The KMS settings from filer.toml and from the identities file went through
two paths: the JSON one was wrapped in an adapter so it could be read like
viper. Both are now parsed into the same settings and loaded by the same
code. Viper lowercases the provider tables in filer.toml but not the values
that name a provider, so a mixed-case default_provider or bucket provider
never matched and failed the load. Those values are now lowercased for
filer.toml. Providers load in name order, a providers or buckets section
that isn't a table fails the load instead of being ignored, and so does a
default_provider that isn't a string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms: test the parser's section types and JSON provider names
A providers or buckets section that isn't a table and a default_provider
that isn't a string fail the parse, and a JSON config keeps the case of
the provider names it uses. The check-once test now loads through the
whole loader, which sets the global provider, so it clears it after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms: pick the first provider by name when no default is set
ListKMSProviders iterated the provider map, so with several providers
and no default_provider the global SSE-KMS provider changed between
loads, and objects written under one could not be read after a restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: report KMS load errors from the identities file
Any failure loading the identities file's kms block was logged at V(2)
as no KMS configuration, which hid the parser's errors and a
default_provider that does not exist. Only a missing block is quiet now.
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>
* kms/local: load master keys from the provider config
The local provider generated its master keys in memory, so a restart or a
reload lost them, and with them every object they encrypted. It now reads a
keys list from its config. Each entry has a key_id, 32 bytes of key_material
in hex or base64, and optional aliases and description. A reload reads the
list again, so objects encrypted under a listed key stay readable.
A name that's already taken, key material that isn't 32 bytes, or
enableOnDemandCreate together with keys fails the provider, and the keys it
loaded before the error are cleared. No default key is generated when keys
are listed, since whatever it wrapped would be lost on a restart. CreateKey
and CreateKeyWithID refuse a name that's taken instead of replacing that key.
GetStringMap copies a list of tables like the other nested values it hands
out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: give a racing on-demand request the key the first one created
CreateKeyWithID refuses a key ID that's taken now, and the on-demand path
looked the key up and created it under separate locks. Two requests for
the same new key could both miss it, and the second then failed with
KMSInternalFailure. The on-demand path checks for the key under the lock
it stores it with, and returns the one stored in the meantime, so the
first request's data key stays readable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: serve requests that name no key with the configured aws/s3 key
With keys configured there is no generated default key, so an SSE-KMS
request without a key ID failed even when the bucket-default path
(which already resolves to alias/aws/s3) would work. Resolve an empty
key ID to alias/aws/s3, as AWS does, so an operator picks the default
by giving a configured key that alias instead of a new setting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* kms/local: refuse a master key that Close cleared mid-request
A reload replaces the provider and closes the old one, which zeroes its
key material in place. A request that looked up a key before the close
could then build its cipher from zeros and store a data key no provider
can unwrap. Build the cipher under the provider lock and refuse a key
that is no longer registered.
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>
* filer: end a subscriber's stall when memory serves its cursor
A metadata subscriber that finds nothing in the ring yet parks until data
arrives ("no readable in-memory entries yet"), which starts its stall
clock. When data arrives the ring serves the cursor and the read goes on,
but nothing stopped the clock: only the paths that leave a gap do.
The clock is what bounds the wait on a gap. With it still running from
that first park, the first real gap the subscriber meets, hours later,
looks older than maxGapStall the moment it parks: the park gives up at
once and skips to the eviction watermark, and the events a peer would have
flushed within the flush interval are never delivered. The log shows a
subscriber "parked" for hours at a cursor a few seconds old, and the gap
skipped in the same millisecond. A mount keeps the stale listing it has
for those events, and filer.sync loses them.
resolve now ends the stall when it sends the read to memory.
* filer: age the first stall in the memory-serves test instead of shrinking maxGapStall
With maxGapStall at 50ms, a scheduler pause between the fresh park and its
give-up check expired the new stall and failed the test against the fixed
code. Keep the real bound and backdate the first park's clock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: shorten the comment on ending the stall in resolve
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>
* sftp: give user store accounts without a Uid a non-root id
An entry that leaves out Uid decoded to 0, and Uid 0 skips every
Permissions check, so a read-only account could write and delete.
Generate a regular id for it the way NewUser does, and default an
omitted Gid to the Uid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: test that an omitted Uid or Gid does not load as root
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: keep the default Uid of an account stable across loads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: test that a default Uid survives Reload and a new store
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: keep a default Uid off the ids other accounts use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: test that a default Uid skips ids other accounts use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: refuse a user store with no free id for an omitted Uid
When every id in the default range is taken, loadUsers now fails instead
of reusing a taken id, and it fails before replacing the loaded users so
a Reload keeps the previous accounts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sftp: test that a full id range rejects the store and keeps old users
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* volume: read the fields it knows from a .vif a later version wrote
The .vif is parsed as strict JSON, so one field this version does not
know fails the whole file. The volume server only logs that and serves the
volume with an empty VolumeInfo: a read-only mark is gone, and so is the
remote file of a tiered volume. Every field added to VolumeInfo makes the
.vif files written from then on unreadable to the versions before it, which
is what a rollback runs into.
When neither the strict parse nor the old format's reads the file, it is
now parsed once more with unknown fields ignored. The fields this version
knows apply, and a warning names the file. The old format is still tried
first, since read this way it would lose its DestroyTime, and a file that
is not a VolumeInfo is still an error.
* volume(rs): read an old-format .vif before the current format
VifVolumeInfo ignores fields it does not know, so an old-format .vif
parsed as it too: its DestroyTime and BytesOffset were dropped and the
old-format fallback never ran. The Go server tries the old format before
reading a file with unknown fields ignored, which keeps the destroy time.
The old format is now taken only when every field in the file is one of
its own, and a file that is not old-format reads as before.
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>
* volume: keep the largest needle id of a leveldb-indexed volume through a vacuum
The index a vacuum builds for a volume with a leveldb needle map is loaded
by LevelDbNeedleMap.DoOffsetLoading, which counted the files and tracked
the end of the data but not the largest needle id, as the in-memory map's
loader does. After the commit the volume reported 0 as its largest id until
a needle with a larger one was written, and after each vacuum again.
The volume server sends the largest id over its volumes in every heartbeat,
and the master keeps its id sequence above it. A server whose largest ids
sit in volumes that were vacuumed since they were last written reported too
small a value, which is all the master has to go by when its own sequence
is behind.
* volume: test the largest needle id when nothing lands during the vacuum
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>
* filer: pace the deletion ledger's snapshots to a byte budget
The durable deletion ledger is written as a snapshot of the whole pending
set, and the snapshotter is woken by every queued and every finished
delete. A filer deleting a hundred chunks a second rewrote the set a
hundred times a second, close to 4KB written to the store per deleted
chunk. The cost of each snapshot is the size of the set, so a filer that
holds deletes it cannot finish yet, the ones it retries, rewrote that whole
backlog on every other change as fast as the store took it.
A snapshot is now followed by a pause in proportion to the bytes it wrote
(filer.deleteQueue.persistBytesPerSecond, 64KiB a second by default, and
4KiB charged per snapshot), never longer than the periodic interval. The
first change after a quiet spell is still written at once; the changes made
during the pause go into the next snapshot. A crash therefore loses the ids
queued since the last write instead of those of the write in flight.
* filer: fix the deletion ledger's write budget instead of a config key
The pacing needs no operator knob: 64KiB a second keeps a large backlog's
snapshots at the periodic interval and a small ledger's at a few a second.
The snapshotter reads the budget and the interval once when it starts, so a
test that pins the budget does not race a running snapshotter.
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>
* filer: count the store's KV requests in the store metrics
FilerStoreWrapper counts and times InsertEntry, UpdateEntry, FindEntry,
DeleteEntry and the listings, but passed KvPut, KvGet, KvBatchGet and
KvDelete straight to the store. Hard link records, the deletion ledger and
the per-path commit records are all kept in KV, so that part of what a
filer asks of its store did not show in SeaweedFS_filerStore_request_total
or in the request duration histogram.
The four KV calls are now counted and timed like the others, as kvPut,
kvGet, kvBatchGet and kvDelete.
* filer: shorten the KV metrics helper comment
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>
* master: sign a LookupVolume token for the file id asked for
LookupVolume signed the token with the bare volume id, and the volume
server checks the token's fid against vid,key, so every token it handed
out was refused. /dir/lookup signs the file id. operation.LookupJwt goes
through LookupVolume, so the expired-token renewals of the S3 PutObject
and copy cleanup deletes, the admin file browser and weed benchmark all
got a token the volume server refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: sign lookup tokens for the base file id
The volume server checks a token's fid against the file id with its
_<delta> suffix stripped, so a token minted for vid,key_N, over gRPC or
/dir/lookup, was refused. Sign baseFid of the file id in both paths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* mq: report the caller's deadline when a broker sees it first
doConfigureTopic checked ctx.Err() to tell the caller's deadline from a
broker failure. A broker's DeadlineExceeded status (or its RST_STREAM,
which gRPC maps to DeadlineExceeded once the deadline has passed) can
arrive before the context's own timer has run, so ctx.Err() was still nil
and NewTopicPublisher returned the wrapped gRPC error instead of
context.DeadlineExceeded. Once the deadline is behind us, wait for the
context's timer before reading ctx.Err().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* mq: let the configure call start before its deadline passes in the test
The deadline the test reported had already passed when NewTopicPublisher
started, so the check before the first broker caught it and the check after
the call was never exercised. The fake broker now moves the deadline behind
us only once it has the call, and answers with its own DeadlineExceeded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* s3: -s3.listRecursiveFromStore, on by default
Lets an operator keep recursive listings on the directory walk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* s3: list without a delimiter from one range of the filer store
A bucket that never had versioning is listed with ListEntriesRecursive:
one read of the bucket's path range per page instead of one directory
listing per directory. A folder object's "<dir>/" key waits for its place in
key order, and the folder objects whose rows sort before the range (the one
the prefix names, those the marker ends inside of) are looked up. .uploads
is skipped; a .versions folder hands the page to the walk, as does a filer
that answers Unimplemented, which is then not asked again for a minute.
The test pages through both ways over the same tree, for prefixes, markers
and page sizes, and expects the same keys, sizes, ETags and markers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* test/postgres_flat: a range-read gateway lists what the walking one does
A second S3 gateway with -listRecursiveFromStore=false runs on the same
filer. ListObjectsV2 and V1 pages agree for prefixes, markers and page sizes
over folder objects, a prefix object, an unfinished upload and +/-/0
neighbours. Listing 60 keys five directories deep scans the bucket table 2
times from the range read and 302 times from the walk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* s3: range-read listings without the -s3.listRecursiveFromStore flag
A filer whose store cannot list a range answers Unimplemented and the
gateway already walks that bucket's directories instead, so the flag only
switched off a path that falls back by itself. The unit test forces the
walk through the decline cache, and the postgres_flat test checks pages
against the keys in byte order rather than against a second gateway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: step a range-read listing over the bucket's upload parts
The walk skips the bucket's .uploads folder as one entry, but a range read
from the bucket root streamed every part of every unfinished upload and
dropped them, one 1024-row window after another, on each first page.
Every path under .uploads/ sorts before ".uploads0", so the read resumes
there and looks up the one key with that name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: list a waiting folder object once a row passes its key
A range-read page queued every childless folder object until a file row
arrived, so max-keys=1 over a bucket of empty folders read the whole
bucket before answering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3: forget a deleted bucket's recursive-listing decline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Reuse of an existing object creates, re-stamps or clears the mark,
which is the model's Adopt action; Retake only resets adoption to retry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A symlink made through weed mount holds no data, so GET and HEAD
answered for it as for an empty file: Content-Length 0 and a type
guessed from its name. An S3 client could not tell it from an empty
file, nor see where it pointed.
For an entry with the symlink mode bit, send the target as user
metadata, x-amz-meta-seaweedfs-symlink-target, escaped like a key under
encoding-type=url, and use Content-Type inode/symlink (what file(1)
reports) when none is stored. User metadata is the one place AWS has for
an object's own fields, so SDKs and the AWS CLI show it as they are. The
link is not followed: the target is a path on the client that made it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>