mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
bd9e9a37c2fde2b169889ba3c8cb3ceead994e43
16590
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bd9e9a37c2 |
mount: send an open's truncate to the write owner as a conditional update (#13113)
An open with O_TRUNC over an existing file stored the empty entry with an unconditional UpdateEntry. The filer only routes conditional writes to the path's write owner, so the truncate landed on the filer the mount talks to, which deleted the chunks it dropped, while a peer's conditional chmod could still commit at the owner over the entry it had not yet seen truncated. The owner's write then brought the deleted chunks back into the entry. The truncate now goes through saveEntryAttributes: guarded by the entry the open found, routed to the owner, and replayed on the owner's entry when refused. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7d1ad72e74 | docs: regenerate star history chart | ||
|
|
89dbcb44c7 |
security: fips.mode follow-ups from the #13029 review (header comments, EMS on verified HTTPS, CA and read checks) (#13110)
* volume: read security.toml section headers that carry a trailing comment The volume server's own security.toml parser compared each whole trimmed line with the section headers it knows, so `[fips] # policy`, valid TOML that Go's viper reads, fell through to an unknown section and its `mode` was dropped: Go enforced the mode while weed-volume ran with FIPS mode off and logged nothing. The same held for `[jwt.signing]` and every other section. Header lines now have a trailing `#` comment removed before they are matched. Refs #13029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sw-client: require the Extended Master Secret on verified HTTPS in FIPS mode In FIPS mode only the `insecure_skip_verify` client configuration, which sw-client builds itself, set `require_ems`. With certificate checks on, reqwest built the configuration and left `require_ems` at rustls's default, which is off for a provider that is not FIPS-validated, so a trusted TLS 1.2 volume server without EMS was accepted where the insecure path refused it. Go requires EMS in FIPS mode. Both FIPS-mode paths now go through one rustls configuration built here: certificates checked against `https.client.ca` or the system roots (loaded with rustls-native-certs, as reqwest loads them), or not checked with `insecure_skip_verify`, and EMS required either way. Off mode keeps reqwest's configuration. Refs #13029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: refuse a FIPS mode from a security.toml parse that did not read the file resolve_fips_setting reads security.toml once to check that it can, then parses it. The parse falls back to defaults when its own read fails and reports that only in `file_read`, which was not checked, so a file that became unreadable between the two reads resolved to FIPS mode off. A parse without `file_read` is now the same FipsModeError::File as a failed first read. Refs #13029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sw-client: refuse a malformed https.client.ca with insecure_skip_verify in FIPS mode The FIPS-mode insecure_skip_verify configuration never parsed `https.client.ca`, so a CA file whose certificate does not parse was accepted there and refused on every other path, where reqwest or the verified configuration load it. The CA is now parsed, and refused when malformed, before it is set aside. Refs #13029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-vector: lock sw-client's rustls-native-certs dependency sw-client depends on rustls-native-certs since the FIPS-mode HTTPS configuration; seaweed-vector depends on sw-client by path, so a --locked build there refused to update its lockfile. The crate was already locked in seaweed-vector; only the edge was missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
276be51d04 |
volume(rs): require the Extended Master Secret on outgoing HTTPS in FIPS mode (#13111)
The outgoing client took reqwest's rustls configuration, which leaves require_ems at rustls's default: off for a provider that is not FIPS-validated. A TLS 1.2 peer without EMS was accepted where Go's FIPS mode refuses it. In FIPS mode the configuration is now built with the same roots, CA and identity, and require_ems set. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
760f88e294 |
filer: bind scoped POSIX locks to the verified token id (#13047)
* filer/posixlock: key lock owners and leases by principal A lock's owner becomes (Principal, Sid, Owner). The principal is server-side state, empty for unscoped callers, so owners with equal client-chosen sid and owner under different principals conflict and never match on unlock, release, reassertion or coalescing. The session index and leases key on (Principal, Sid). Scoped sessions are leased per key from their first acquisition: the lease ends at the earlier of TTL after the last acquisition or renewal on that key and Lease.NotAfter. Expired scoped locks are dropped before any operation on their key as well as by ReapExpired. Unscoped sessions keep their current whole-session lease, started by the first keepalive. The handler passes the unscoped session for now, so behaviour is unchanged. NewManagerWithClock lets tests drive lease boundaries. * filer: bind scoped POSIX locks to the verified token id PosixLock trusted the client-supplied sid. GET_LK reports a conflicting lock's sid and owner, so a scoped caller with a write grant on the same path could reuse them to unlock or release another holder's lock, keep it alive, or replace it through a KEEP_ALIVE reassertion. A tokenless request with the same identity could do the same. A request admitted for a scoped token now acts for that token's verified jti, derived in posixLockAuthority from the interceptor's authority. It controls only the locks it took, whatever sid or owner it names. Its lease on each key ends at the earlier of the 15s TTL after its last acquisition or renewal and the token's expiry plus the clock leeway. Each renewal passes admission for its key, so a narrower token cannot extend keys outside its grant. Tokenless and unscoped calls keep the unscoped namespace and behaviour, and can no longer match a scoped lock. Scoped TRY_LOCK and reassertion ranges must be well-formed read or write ranges, checked before any state changes. GET_LK, the protobuf and forwarding are unchanged; the principal is never returned or logged. A renewed token with a new jti is a new owner: the old locks expire and are reacquired. * filer/posixlock: release an expired session once, however many ranges it holds * posix locks: report a lock lost on re-assertion to the mount A mount whose lease lapsed, for example when its scoped token expired or was replaced by one with a new id, kept re-asserting locks that another session had since taken. The filer logged the loss but returned success, and the mount discarded the reply, so nothing on the mount side showed it. KEEP_ALIVE now returns the first conflicting lock in the existing has_conflict and conflict fields, which older mounts ignore. The mount warns once per key when it learns of a loss and forgets it once a re-assertion succeeds or the key is no longer held. Writes are not fenced. * filer/posixlock: drop every expired session's ranges in one pass * filer/posixlock: renew a scoped session's same-grant leases together Scoped leases expire per key and a keepalive renewed only the key it named. A mount renews its keys one keepalive at a time, so with many keys and slow keepalives a round could outlast the 15s lease and a healthy mount lost locks; unscoped sessions never had this problem because any keepalive renews the whole session. Each scoped lease now records a fingerprint of the verified grants it was acquired or re-asserted under: a SHA-256 over the sorted, deduplicated (access level, path) entries. A keepalive, bare or re-assertion, extends every live lease of the same session (principal and sid) held under the same fingerprint, each to the request's lease (the earlier of the TTL and the token's expiry plus leeway). Leases taken under other grants, such as a narrower token reusing the jti, are still renewed only by name, and a lease that already ended is not revived before the sweep drops it. No extra filer lookups; unscoped sessions are unchanged. * filer/posixlock: bound same-grant renewal and refuse ended-lease grants A scoped keepalive scanned every key of its session to renew those held under the same grant, so a mount renewing N keys one by one did N^2 lease visits per round under the manager's mutex. The scan now runs at most once per quarter lease TTL per grant; every key under the grant still ends no earlier than three quarters of a TTL after the latest renewal, and the named key is always renewed in full. TryLock now refuses a scoped grant whose lease has already ended, such as a request admitted just before its token expired that then waited on the manager, instead of granting a lock the next operation would drop. The filer returns Unauthenticated, which the mount reports as EIO. * filer/posixlock: skip same-grant scans by deadline floor, not by time The scan throttle remembered when a grant was last renewed, not how long that renewal made its keys last. A replacement token with the same id and grants but a later expiry could then renew one key while the others kept ending at the old token's expiry. Each session now keeps, per grant, the deadline the last scan gave every live key under it, lowered whenever a key is leased for less. A renewal skips the scan only while that floor already reaches the earlier of its own deadline and three quarters of a TTL from now, so a mount renewing keys one by one still costs linear work. A keepalive from a session holding no leases records nothing, and a session's floors go with its last lease, so lock-less keepalives with changing session ids no longer accumulate state the sweeper never sees. * filer/posixlock: never move a scoped lease's deadline earlier Renew, a re-assertion, a same-grant scan and a re-lock all set the key's deadline to the request's own bound. A request under the old token of a principal that already renews under a replacement (same id and grants, later expiry) can land after the replacement's renewal, for example one of the 32 concurrent keepalives in flight when the mount switched credentials. It then cut the key back to the old token's expiry, and the lock was dropped before the next round although the replacement had renewed it. Keep the later of the current and the requested deadline: every deadline still comes from an admitted request of the same principal, so a lease never outlives the latest of its tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer/posixlock: keep each session's index and leases in one map bySession, lastSeen, leases and floors were four maps keyed by Session that had to be created and pruned together. They become one sessions map whose sessionState holds the session's keys (with each key's lease), its last keepalive and its grant floors, so a session's state is dropped in one place. The release loop shared by ReapExpired and ReleaseSession becomes releaseOn. ReleaseSession now also forgets an unscoped session's last keepalive, so a session it released is not reported again by the next sweep. 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> |
||
|
|
46b10efcce |
mount: refuse a stale truncate over a peer's chunks and keep later times when merging a flush (#13100)
* mount: refuse a merge whose local truncate cuts chunks a peer wrote A flush refused by IF_ENTRY_EQUAL replays the handle's truncate onto the stored entry. The truncate was made over the handle's base, so a chunk a peer committed after that base was dropped or clipped silently, losing data the peer had already fsynced. Like a stale whole-file rewrite over a peer's chunk change, it now fails the merge. A base chunk the peer only shortened carries no peer data and is still cut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep the later mtime and ctime when merging a delayed flush The merge took every attribute the handle changed from the handle, so a flush that waited behind a peer's commit moved mtime and ctime back to the handle's older write. Each time is now merged as one value (seconds and nanoseconds were merged field by field, so a moved second could take the peer's nanoseconds): the handle's time stands unless a peer moved it too and later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: let a truncate merge pass the handle's own committed chunks A flush whose commit answer was lost finds its own chunks in the stored entry while its base is still the older one. Those chunks are the handle's writes, not a peer's, so they do not refuse the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: do not keep a stored copy of a chunk the merge re-adds from the handle A stored chunk the base lacks but the handle holds is the handle's own commit whose answer was lost. The merge appends the handle's chunks after the stored ones, so keeping the stored copy referenced the chunk twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: take the manifests of a failed flush's fold for the handle's own chunks A flush can commit its folded manifests and lose the answer. The handle reverts to the member chunks and keeps its old base, so the next merge found the stored manifest, knew neither its file id nor its key, and refused it as a peer write across the handle's truncate. The handle now remembers the folds of flushes that failed over its base, and a merge unfolds them in the stored entry before comparing, so the members match the handle's chunks. A peer's manifest is still refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: take a retried flush's own stored fold for its own chunks The client retries a request whose connection dropped, and the first try may have stored the flush's folded manifests. The retry is then refused over them before the fold is recorded as failed, and the merge took the manifest for a peer's write across the handle's truncate. The merge now unfolds the flush's own fold in the stored entry as well; the condition still names the entry as stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep every fold the filer may hold instead of the last four Dropping the oldest of four could forget the fold the filer committed, and the merge then refused that manifest again. A fold is now kept only when the flush failed without the filer's answer, or when the refusal lookup shows it stored, so a refused flush no longer adds one, and the list ends with the base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep a flush's fold when its first request may have been stored A precondition verdict on a retried send does not prove the first send stored nothing, and a failed refusal lookup then hid that it had. The create now counts the sends of the request that carries the fold and keeps the fold whenever the flush fails and that request was sent more than once or never got the filer's answer. That covers both flush paths, so revert is back to only restoring the chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drop the failed folds a refused create shows were not stored A refusal means the stored entry moved off the handle's base, so no request guarded by that base can store another fold. After the refusal lookup the handle keeps only the folds whose manifests the stored entry holds, at most one, which bounds the list over a base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: bound the failed folds a handle keeps over one base Flushes that keep failing with no filer answer each saved a new fold the filer may hold, so the list grew for as long as the outage lasted. Once a handle keeps maxFailedFolds folds over its base, its flushes send their chunks unfolded for the filer to fold, and no kept fold is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep the failed folds a refusal lookup does not show The refusal comes from the file's write owner, but the lookup after it can read a filer that lags behind and still shows the base. Pruning the folds against that read forgot a fold the owner had stored, and once its manifest showed up a pending truncate took it for a peer's chunk on every flush. The maxFailedFolds limit bounds the list, so the folds stay until the base moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drop the chunks a failed flush sent that the handle has cut since A flush that commits with its answer lost, then a truncate of the handle, left the next merge with the handle's own committed chunks in the stored entry, outside both base and the handle. The truncate check took them for a peer's writes and refused every later flush over the base. A failed flush now records the file ids of the chunks it sent that base lacks, and the merge drops those the handle no longer holds: it cut or replaced them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: copy the failed flush's sent set with a loop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep folding past maxFailedFolds instead of sending chunks unfolded The filer folds a flat chunk list itself, into manifests the handle does not know: a lost answer then left one of them across a pending truncate, and an acknowledged one gave the handle flat chunks under a folded base. Flushes fold as before, and the handle stops keeping folds past the limit while it still records the chunks they sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: read the stored manifests a refused merge cannot name A fold changes no content, but a manifest the handle does not know sat in the stored entry as one chunk: across a pending truncate it refused the merge, though it can hold the handle's own chunks (a fold it did not keep, or one the filer made). When the merge is refused, the flush reads those manifests, replaces them with the chunks they hold and merges again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: hold the chunks the filer stored after a plain acknowledged flush The filer folds a flat chunk list (the mount's own fold failed), and the acknowledgement makes the stored entry the base while the handle kept the flat chunks. A later merge took them for writes of the handle, which can bring back chunks a peer's truncate removed. As after a merge, the handle now takes the stored chunks, keeping those attached since the request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep a bounded record per failed flush instead of a growing set The set of chunk ids failed flushes sent grew with every overwrite while commits failed, and each failure copied it whole. Each failed flush the filer may have stored (a send got no verdict) now keeps one record, its fold and the ids it sent, built once and at most maxFailedFlushes over a base. Past that, a merge refuses the chunks of a flush it did not keep that the handle has cut since, as a peer's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: register the chunks a rebase or install gives the handle for reads A handle that takes the stored chunks after a flush (or a peer's, after a merge) can get manifests the filer made, and resolving them needs the file's read token. rebaseEntry and installRewrittenChunks now record the chunks under the file's path before the read view resolves them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep every chunk id a failed flush sent, cap only the folds Past four failed flushes over one base the handle stopped recording what a later flush sent. If that flush was stored with its answer lost, a truncate of its chunks was refused as a peer's write and kept failing after the filer came back. The ids now go into one set shared by the base's marks, each kept once and never copied, until the base moves. Only the folds stay capped: a stored manifest past the cap is read when a refused merge cannot place it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: fail a flush over a peer's chunk change unless -concurrentWriteMerge A content flush refused because another mount committed first used to merge the handle's writes onto the stored entry. That merge now runs only with the new -concurrentWriteMerge mount option (off by default). By default a stored chunk change that neither the base nor the handle holds fails the flush with EIO, and a peer's chunk event no longer rebases a dirty handle. Attribute-only changes and the handle's own commits (a lost answer, its own truncate) still merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: recognize the shortened references a failed flush sent A truncate shrinks a base chunk in place, keeping its file id. A failed flush that may have stored such a reference recorded only file ids base lacks, so a later truncate saw its own stored reference as a peer's change and failed with EIO by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a963c1309c |
worker: purge the filer metadata log from a lifecycle job that keeps it past every TTL (#13101)
* worker: share the one-filer-per-store selection with other filer jobs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: add a meta_log_purge job that keeps the log past every TTL The job deletes whole metadata log days once per filer store, keeping every day that the longest filer.conf TTL, the longest S3 lifecycle rule, a registered retention floor or a running replay job's cursor still needs. A floor input that cannot be read stops the run before anything is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: register meta_log_purge in the lifecycle lane Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * maintenance: stop purging the metadata log from the default scripts The meta_log_purge job now deletes old log days, keeping what TTLs, lifecycle rules and replay jobs still need. fs.log.purge stays for manual use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: let an idle filer_ttl rule's read position release the log filer_ttl no longer needs events up to read_ns, and an idle rule keeps an old ts_ns while read_ns advances, so the floor follows the later of the two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: cap min_retention_days so a huge value cannot overflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: show the min_retention_days limit in the admin form Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: give a registered retention floor the store's filer client A floor that only gets a context cannot tell which cluster or store it answers for, so it cannot ask that cluster's master or read the store's own settings. Pass the filer client the job already holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: keep the log an unfinished lifecycle walk will replay A cold-start or recovery walk that resumes across runs rewinds its shard cursor to the walk's start minus the longest lifecycle TTL once it completes. Until then only its walk checkpoint records that start, so a walk running for more than a day let the purge delete the creation events the rewound replay reads. A checkpoint with buckets done or partly walked now holds the floor at started_ns minus that TTL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: hold the walk start until the checkpoint goes stale A walk clears its checkpoint in finish() before each of its shards saves the rewound cursor, so a purge scan that read the old shard cursor and then the cleared checkpoint saw neither. A cleared checkpoint keeps started_ns, so every live checkpoint now holds the floor at its start minus the longest lifecycle TTL. A finished one stops holding once it has not been saved for cursorStaleAfter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: read walk checkpoints before the shard cursors they rewind A purge scan that read a shard cursor, then a checkpoint that a later walk had already replaced, saw neither the earlier walk's hold nor the rewind its shards saved. A walk replaces its checkpoint only after the previous walk's rewind is on disk, so reading the checkpoints first always sees one of the two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * lifecycle: save a fresh walk's checkpoint at its first progress A walk that progressed during its first save interval and then stalled for more than a day had no checkpoint on disk, so the metadata log purge saw nothing holding the days its completion replays. A fresh walk now saves on its first finished entry or bucket; a resumed walk already has its record on disk and keeps the interval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * lifecycle: rewrite an unchanged shard cursor so its mtime stays fresh A shard stuck on RETRY_LATER saved identical bytes each pass, and SaveInsideFiler skips identical content, so the file's mtime aged past the meta log purge's staleness cutoff while the shard still needed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: keep the log day a reader from the cursor lists first Log files are named for their flush start, so a file from just before midnight holds events after a cursor just past it. The reader backs off one flush interval before choosing its first day; the purge now does too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: stop the meta log purge on an unreadable lifecycle policy LoadCompileInputs reports a bucket whose lifecycle XML does not parse separately from its error, so the purge used the shorter floors and deleted days that bucket's rules may need once the policy is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: read shard cursors with the replay's loader in the meta log purge A shard cursor the replay refuses, such as an empty object, decoded as a zero position and released the purge; it now stops the run instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: saturate the meta log purge's TTL plus a day A lifecycle TTL near the largest duration wrapped negative once a day was added, so the purge fell back to the shorter floors; the walk hold at started_ns minus that TTL likewise dropped below zero and was lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: leave disabled lifecycle rules out of the meta log purge floor AllActivePriorStates activates every compiled rule, so a disabled rule still held the log for its TTL, and disabling it could not release it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: compute the meta log purge floor in SafeKeepFrom Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: fs.log.purge keeps the logs the meta log purge floor needs unless -force Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: run the fs.log.purge floor test without a master client Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3836311f8f |
filer: end a listing at a short page, and make every store fill its pages (#13105)
* filer: end a listing at a short page from a store that fills its pages ListEntries read a directory a page at a time and stopped at the first empty page, so every listing the caller's limit did not cut ended with one more scan of the store, from the last name on, that returned nothing: two scans for a directory smaller than a page. A page that comes back short of its limit now ends the listing when the store says it fills its pages (the new optional FullPageListingStore). leveldb, leveldb2, leveldb3 and TiKV do: they iterate the directory's keys until the limit is handed over or the keys end. A store that cuts a page of names to the limit and then drops some (the Redis stores, for a name whose entry is gone or expired) can end a page short with names behind it; it does not declare the interface and is asked until a page comes back empty, as before. TiKV's listing swallowed an iterator error while it skipped the start name or an expired entry, and ended the page there. It returns the error now: a page that ends short must mean the keys ended. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: see through the path translator for a store that fills its pages A path-specific store is wrapped in FilerStorePathTranslator, which does not implement FullPageListingStore, so its directories kept the extra empty scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the last listed name when a refill lists nothing A page that lost entries to expiry is refilled from its last name. A refill that found nothing returned an empty last name, so the next page of a store that does not fill its pages started over at the top of the directory and listed every entry again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: name the stores that fill their pages instead of an interface A short list of store names in Filer.ListsFullPages replaces the FullPageListingStore interface, the wrapper method and the per-store declarations. A path translator reports its backend's name, so it needs no unwrapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * foundationdb: read a listing in batches until it fills the page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis: fill a listing page past orphaned and expired members Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * redis2: fill a listing page past orphaned and expired members Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mongodb: report a cursor error that ends a listing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tarantool: fail a listing on a malformed reply Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test the last listed name after a refill that lists nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: end a listing at a short page from any store Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rocksdb: build the tests against the current NewFiler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rocksdb: count only listed entries toward the page limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rocksdb: return the decode error instead of ending the listing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
5a9287642f |
filer: cap list snapshots at the peers' delivery watermark (#13109)
A listing's snapshot only accounted for this filer's in-flight writes. A peer on the same store can have stamped a write below it that is not committed yet; the listing misses it and the client drops its event as already listed, leaving a stale entry (a mount reads a just-closed file as empty) until the next listing. |
||
|
|
f9b494c576 |
filer, s3: give an entry without chunks the ETag of its inline content (#13106)
* filer, s3: give an entry without chunks the ETag of its inline content A file written through a mount stores no MD5. With no chunks either (an empty file, or a small one kept inline) S3 answered HEAD, GET and listings with an empty ETag, and the filer's HTTP API with the chunk form for zero chunks, "d41d8cd98f00b204e9800998ecf8427e-0". Both now answer with the MD5 of the inline content, which for an empty file is what AWS gives an empty object and what the same file gets once it is written through S3. An entry whose size reaches past its inline content (a hole that no chunk covers) keeps the ETag it had. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: match If-Match on an entry without chunks against its inline-content ETag The gateway now answers the MD5 of the inline bytes for an entry with no stored MD5 and no chunks; the filer's conditional check still saw an empty ETag, so a PUT with If-Match set to the ETag HEAD returned failed with 412. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> |
||
|
|
db0ec9e9b3 |
filer: count and time the gRPC requests by method (#13107)
* filer: count and time the gRPC requests by method
The filer's request metrics cover its HTTP API. The mounts and the S3
gateway reach it over gRPC, so on a cluster used through them the filer
reported its store operations and nothing about the requests behind
them: how many lookups, creates, renames or listings arrive, how long
each kind takes, how many end in an error.
Two metrics for the gRPC port, filled by a unary and a stream
interceptor: SeaweedFS_filer_grpc_request_total{method, code} and
SeaweedFS_filer_grpc_request_seconds{method}. A stream is counted when
it ends, and timed unless the client holds it open (a subscription, a
client stream). A lookup that finds nothing returns ErrNotFound without
a status; it is labelled NotFound rather than Unknown.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* filer: label a call ending in its context's error as gRPC reports it
A handler that returns ctx.Err() reaches the client as Canceled or
DeadlineExceeded; status.Code labelled it Unknown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: count a health watch without timing it
grpc.health.v1.Health/Watch stays open until the client leaves, so its
duration is the connection's lifetime, like a subscription's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* metrics: dashboard panels for the filer's gRPC requests
Calls, errors by code, and p99/p50 durations by method, in the Filer row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
|
||
|
|
207aa69a9d |
filer: keep the metadata log in its own collection, with room reserved for it (#13102)
* filer: grow the metadata log collection on its own, fall back when it is full metaLog.volumeGrowthCount (default 2) is sent with assigns into the metadata log collection, so it grows by a few volumes instead of the master's default growth. When that collection cannot take the piece, the assign falls back to the collection the log uses without the override, so a full cluster does not stall the log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the metadata log in its own collection by default metaLog.collection now defaults to filer-meta, so purging old log days empties whole volumes instead of leaving log chunks scattered across the default collection's volumes. Setting it to "" keeps the log in the filer's -collection as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: default -max to 10 to leave room for the metadata log collection The default collection still grows by 7 volumes; the extra slots keep the filer's metadata log collection (2 volumes by default) from taking them. Go and Rust volume servers share the new default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: bound the meta log collection's share of the assign budget A meta log collection that cannot grow (for example a replication the cluster cannot place) keeps answering with retryable errors, so the first assign used the whole shared budget and the fallback was never tried. Give it 10s, then fall back, and skip it for a minute after a failure instead of waiting on it at every flush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: name the default meta log collection so no bucket maps to it A bucket named filer-meta mapped to the same collection, and deleting it from the admin page or weed shell drops the collection directly at the master, taking the metadata log with it. Bucket names cannot contain "_", and filer group buckets map to "<group>_<bucket>". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: clear the meta log overrides after the viper test Setting the collection back to its default value kept an explicit override, so the defaults test passed even without the SetDefault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: retry the meta log collection once its fallback also fails The pause after a failed meta collection assign kept pieces on the shared collection for a full minute even when that assign failed too, so meta volumes that finished growing stayed unused while every flush failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: pick a default meta log collection no grouped bucket maps to Filer group "_filer" with bucket "meta" maps to "_filer_meta". The default now keeps its only "_" in front, and the test checks every group and bucket split of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: default the meta log collection to _meta Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the default meta log collection on bucket delete A filer that logs elsewhere did not treat _meta as reserved, so deleting a bucket a storage rule maps to _meta dropped the collection other filers write their logs to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
036d1117d2 |
fix(s3api): refuse a "dir/" PUT body larger than a directory marker holds (#13104)
* s3api: refuse a "dir/" PUT body larger than a directory marker holds A key ending in "/" whose body had no Content-Length took the marker branch, was read whole into memory and stored inline in the directory entry. One declaring more than 1024 bytes took the regular path, which wrote it to the object "dir/dir". Both now get EntityTooLarge: a declared length is checked before the body is read, an unknown one is read at most 1025 bytes. An aws-chunked body counts by its decoded length. * s3api: size an aws-chunked "dir/" body without a decoded length as unknown Without X-Amz-Decoded-Content-Length the marker check fell back to the encoded Content-Length, whose chunk framing pushed a marker of up to 1024 bytes past the limit. Such a body is now read through the limit instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: keep a "dir/" body past a marker as a version in a versioned bucket A versioning-enabled bucket stores a trailing-slash key larger than a marker as a versioned object under its .versions directory, so refusing it broke that write. Only the unversioned and suspended paths, which would land on "dir/dir", refuse it now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: recheck a large "dir/" PUT against the versioning state its write uses The size check and the write path each read the versioning state, so versioning suspended in between sent the body to the suspended path, which writes "dir/dir". 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> |
||
|
|
7092edfb06 |
webhook: keep the bearer token on the configured endpoint's host (#13103)
* webhook: send the bearer token only to the configured endpoint's host A redirect to another host or port, or from https to http, now gets the request without the Authorization header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: test the token scope across redirects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: compare effective ports when scoping the token An omitted default port and an explicit :443 or :80 are the same endpoint; http on port 80 upgrading to https on 443 keeps the token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4ff3147ee5 |
worker: filer_ttl job removes expired rows from stores without native TTL (#13084)
* worker: add a filer_ttl job that walks filer.conf TTL paths A filer store without native TTL keeps the rows of expired entries until something looks them up or lists their directory. The job lists every TTL path subtree once per filer store, so the filer drops the expired rows it meets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: register the filer_ttl job in the lifecycle lane Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: re-check an expired entry under its path lock before a listing deletes it A listing deleted the expired entries it collected by path after the page was read, so a write that replaced one in between lost its new row. The delete now re-reads the row under the lock writers take, and in one conflict-checked transaction on stores that refuse a commit over another writer's change; anything but a still-expired row is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: read each filer store's own filer.conf, chunk-backed included Filers with separate stores keep separate filer.conf files, so one filer's rules could hide another store's TTL paths. A config stored in chunks read as empty. An unreadable config now fails the detection instead of reading as no rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * command: count filer_ttl among the mini default job types Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: resume an unfinished filer_ttl walk from its checkpoint The walk position is saved in the job's filer store every 30s and at the first failure, keyed by store signature, and cleared when a pass completes. The next run skips the prefixes and subtrees already walked, unless the TTL prefix set changed or the pass is over 7 days old. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: save the filer_ttl checkpoint as soon as a walk fails The first failure froze the checkpoint but only the end of the run saved it, so a worker killed while walking later prefixes lost it. stop now saves it at once; the end of the run saves again only if that save failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: keep a path TTL rule from expiring the filer_ttl checkpoint A filer.conf TTL rule over /etc/ gave the checkpoint that rule's TTL, so an interrupted pass could lose its record long before checkpointMaxAge. The checkpoint is now written with its own TTL of checkpointMaxAge, which the filer keeps instead of the rule's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: remove a filer_ttl checkpoint the new pass will not resume from An overwrite keeps the stored entry's Crtime, and the checkpoint's TTL counts from it, so a pass that replaced a rejected record could lose its own record before checkpointMaxAge. load now deletes a record it rejects, and the new pass creates a fresh one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: expire filer_ttl entries from metadata events per TTL rule Each run replays every filer.conf TTL rule's metadata events from that rule's cursor up to the run start, and looks up each entry whose TTL has passed so the filer removes its row. The first entry not yet due holds the rule's cursor, so a later run replays it. A rule without a cursor, or whose TTL changed, is listed once to reach rows older than its replay window. The periodic full walk and its checkpoint are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: re-check an S3-expired entry under its path lock before a listing deletes it A listing deleted an S3-expired object by the row it had read, so an upload that replaced it after the page was read was removed. The delete now re-reads the row under the path lock and removes it only if it is still S3-expired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: remove an expired row a lookup meets in a conflict-checked transaction A lookup that met an expired row deleted it by path, so a replacement written through another filer between the read and the delete was lost, even on stores that refuse conflicting commits; a failed delete was hidden behind not found. The lookup now re-reads and deletes through deleteIfExpired and returns the delete error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: keep a failed filer_ttl lookup that ties a done event When the first event at a timestamp was done and the second one's lookup failed, the cursor already stood at that timestamp, so the retry subscribed after it and skipped the failed event. A failed lookup now holds the cursor below a tie, as a waiting entry does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: hold a filer_ttl event whose entry the filer still serves A lookup that returned the live entry counted as done, so when the worker's clock ran ahead of the filer's near the deadline the event was skipped and the row stayed. An entry the filer still serves with the same deadline now holds the cursor like one not yet due. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: keep a path TTL rule from expiring the filer_ttl cursors The cursors were written without a TTL, so a filer.conf TTL rule covering /etc/seaweedfs/filer_ttl gave them the rule's TTL and every rule was listed again once they expired. When a rule covers them they are now written with a TTL of their own, which the filer keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: list a filer_ttl rule again for a live entry its replay cannot reach A new rule nested under a longer one started its replay one TTL back, so a live entry the enclosing rule had stamped with its longer TTL, written before that, was in neither rule's replay: the nested rule now owns it and the enclosing rule skips it. The listing of a new rule now records the earliest deadline of such entries, and the rule is listed again then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: hand a removed filer_ttl rule's replay to the rule enclosing it When a nested rule was removed, its entries became the enclosing rule's, but that rule's cursor could already be past their events, so they were never replayed. The enclosing rule now replays from the earlier of both cursors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: list a filer_ttl rule whose unfinished events the filer no longer keeps When fs.log.purge removed the event of an entry still waiting for its TTL, the rule's cursor matched, so the rule was never listed and the replay never met the entry again. A rule whose cursor is older than the oldest kept metadata log is now listed, and its cursor moves to that log. The cursor also records how far a replay read with nothing left waiting, so a quiet rule is not listed just because old logs were purged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * worker: leave S3 lifecycle expiry to the s3_lifecycle job in filer_ttl An entry whose TTL an S3 lifecycle rule set carries the S3 expiry flag; s3_lifecycle evaluates and removes it. filer_ttl no longer looks such entries up, and their deadline no longer holds a TTL rule's cursor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0ea67a4438 | docs: regenerate star history chart | ||
|
|
663af6fccb |
mount: review fixes for the metadata follow shutdown (on top of #13092) (#13097)
* mount: drop the issue number from the shutdown test comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: end the filer walk when the consumer stopped following Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * pb: end the follow when a retried event reports a stop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: check the subscriber is gone before the late event can end it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: never retry a filer call whose consumer stopped following The walk already stopped on pb.ErrStopFollowing, but RetryOnError still classified the wrapped error by its cause, so a transport-looking cause reran the whole filer walk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * pb: keep the cursor behind an event whose retry the follow ended Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: close the meta cache after the follow-cancel test joins it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
63ab6c6190 |
mount: stop the metadata follow before closing the meta cache (#13092)
* test(mount): reproduce the #5289 mount abort on a late metadata event A metadata event that arrives after metaCache.Shutdown() reaches glog.Fatalf through FatalOnError, so the mount dumps every goroutine and exits 255 instead of unmounting cleanly — the signature reported in issue #5289, still reachable on current master. The subscriber has no way to stop: its context is rooted at context.Background() and util.RetryUntil always retries, while unmount closes the cache underneath it. glog.Fatalf cannot be intercepted from another package (glog's logExitFunc is unexported), so the reproduction runs the mount in a child process and reads its exit code. * mount,pb: stop following metadata when the cache closes The mount follows metadata with FatalOnError, so an event that arrives after metaCache.Shutdown() — which unmount guarantees, since the subscriber is never stopped — was logged as a fatal and aborted the process with a goroutine dump. Report a closed cache as pb.ErrStopFollowing, a class the follow loop ends on instead of routing through the per-event error modes. It is not a failed event but the end of the subscription: no later event can land either. SubscribeMetaEvents then leaves its retry loop rather than reconnecting onto a store that no longer exists. Also export the meta_cache sentinel as ErrClosed so consumers can tell a closed cache from a storage failure. * mount: end the metadata follow before closing the meta cache The subscription goroutine had no owner: its context was rooted at context.Background() and util.RetryUntil retried forever, while unmount closed the cache underneath it. Every unmount left a window in which a filer event landed on a closed store, and the mount survived it only because the previous commit demoted that error. Give the follow a context the mount owns, and stop it — cancel, then join — before metaCache.Shutdown() in both teardown paths. MetadataFollowOption takes a ParentContext so cancelling the caller ends the stream, which is the ordering the filer already got in #11363 and #11663; the mount had no equivalent. Verified that the new assertion catches the ordering on its own: making stopMetadataFollow a no-op fails it with the subscriber still running, even with the fatal path already demoted. * mount,pb: make a cancelled follow a stop, and cover the new seams Review findings on the previous commits: Cancelling the follow context surfaced as a bare gRPC Canceled, which matched neither terminal condition, so every clean unmount logged an ERROR, ran the retry callback — which wipes every cached listing on the assumption that events were missed — and slept a second before the loop stopped itself. Test the context instead of the error text. Also assert the two new weed/pb seams where they are defined rather than only through a mount exit code: ErrStopFollowing ends the stream without reaching the per-event error modes and leaves the cursor behind the event, and a cancelled ParentContext ends the stream. Publishing the cancel handle and bumping the WaitGroup happen under one lock, so a start racing a stop cannot let the join report success too early. All four new tests were mutation-checked: dropping the early return, ignoring ParentContext, removing stopMetadataFollow from ClearCacheDir, and making stopMetadataFollow a no-op each fail their own test. --------- Co-authored-by: whitefox <whitefox@mayflower.work> |
||
|
|
a7cc8fb767 |
filer, docs: 503 in the upload wait flag help; Yandex restart after a token refresh (#13096)
* filer: flag help names the 503 an upload gets after the wait The filer answers an upload that found no slot within -inflightUploadDataTimeout with 503 and Retry-After: 1, not 429. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: a restart after a Yandex token refresh may need a new token The client keeps the refresh token Yandex returns in memory only, and Yandex does not say whether the stored one survives the rotation, so the doc no longer promises that a restart keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ef0967bead |
filer: read the entry path once per write (#13090)
* filer: read the entry path once per write A create looks the path up to decide what it makes of the entry: the inode and crtime to keep, the chunks the write leaves behind, the old side of the metadata event. The store wrapper looked the same path up again, in handleUpdateToHardLinks, to learn the hard link the name carried before. Both reads happen under the same per-path lock, a moment apart, and for a file written without a hard link the second one decides nothing at all: its result is discarded. An overwrite pays for it twice over, because that read decodes the row being replaced -- gunzip included above CountEntryChunksForGzip -- and it is the row the create already holds. Neither read shows up as a second find in the store metrics: the wrapper's goes to the actual store, and FilerStoreCounter counts only FilerStoreWrapper.FindEntry. The wrapper now takes the caller's word. InsertEntryReplaces and UpdateEntryReplaces carry the entry a caller read to handleUpdateToHardLinks, which keeps to it instead of reading the path again. An insert whose lookup found the path empty goes the way #13006 opened with InsertEntryKnownAbsent, which rename alone used. Which word may be taken is the delicate part, so Filer.findEntry reports whether its answer is what the store holds at the path: - a lazy fetch from a remote mount serves an object the store does not have and writes nothing to it, so it says nothing about the row there; - inside a store transaction a lookup hides an expired S3 entry whose row the transaction keeps until the commit, and a write replacing it still owes that entry its hard link -- which is why FindEntryForOverwrite exists; - where the expiry check deleted the row, the delete dropped its link already, so an answer of "empty" is honest. The write also reads the path itself whenever there is a link to take off, for two reasons. A file with a hard link has its record changed again when the store refused a commit (changeLinkRecord runs its change up to linkRecordAttempts times), and each run must judge the name as the store holds it by then. And a row that carries a link is the row whose link this write drops: plain creates are not routed to the write owner, so another filer may have replaced the same name already and dropped that link, and dropping it twice deletes the record under the file's remaining names. What is trusted is the case with nothing to decide -- no link on either side -- which is an ordinary file write, since a mount makes a link id only when a file is linked or copied. The HTTP append path read the entry three times: once to merge with it, once to prove it had not changed while the chunks were uploaded, and once in the create. The create takes the recheck's entry now. A 20-chunk entry on leveldb2 goes from 343 to 286 allocs/op and from 44.6 to 38.3 KiB/op per overwrite, the difference being the decode of the replaced row. Where the store is reached over the network, the read saved is a round trip per write. Tests count the reads one write makes at the store, pin that a dropped link is dropped once against a row another filer has already replaced, and keep the create using the entry it is handed. #9645's own guard expected the create's lookup to be what separates passing existing from passing nil; both are one read now, so it requires one read either way and checks the crtime came from the entry passed in. Issue #5067. Review of the first version caught one more case. The known-absent shortcut must not take an entry that carries a link: InsertEntryKnownAbsent counts the name as joining without reading it, so another filer storing that name for the same link between this lookup and the write would have it counted twice, and the count would run one above the names. The regular insert reads the name inside the change of the record. CreateEntry and ReplaceFileForRename keep the write's own read for a linked entry; TestNewLinkedNameStillReadsThePath pins it. * filer: drop issue numbers from the write-read test comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: say a plain-over-plain write can miss a link stored after the read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: whitefox <whitefox@mayflower.work> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e7cbfdcc44 |
s3: blame no filer for a deadline gRPC reports before ctx.Err() (#13098)
The filer walk told the caller's expiry apart from a filer failure by ctx.Err() alone. A server-side DeadlineExceeded can reach the client before the context's own timer runs, so the walk recorded a failure against each filer and moved on with no budget left, the same race LookupVolumeIds already guards against. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5b7e2d9e9e |
fix: retain released lock version watermarks (#13083)
* fix: retain released lock version watermarks * fix(lock_manager): scope release records to lease identities Keep a stable acquisition ID in opaque renewal tokens so release history cannot reject a valid lease from a different primary when generation counters overlap. Preserve earlier releases across new acquisitions and ownership eviction. Carry the maximum lease expiry with releases, prevent renewals from shortening that bound, reject expired inserts, and reclaim release records after expiry. Track replication and handoff before sending copies so local-only leases need no release records. Add regressions for fresh-primary failover, equal and lower generation counters, reordered releases and renewals, bounded retention, local-only workloads, ownership eviction, legacy release metadata, and gRPC release handling. * lock_manager: name the release replay tests after the behavior they check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(lock_manager): serialize lease handoff with local mutations Hold per-key mutation admission through a fresh lease snapshot, the transfer RPC, and source demotion or removal. A release that wins first suppresses the transfer; a release arriving during handoff waits and is forwarded to the new primary afterward. Keep incoming replication outside the gate to avoid callback cycles. Retain source authority on transfer errors and apply transfer completion only to the lease that was sent. Add real gRPC regressions for releases during both handoff branches and replay after release, plus coverage for fresh snapshots, transfer errors, unrelated keys, and replacement leases. * fix(lock_manager): retry handoffs without retaining renewal authority Deliver a source-held lease to the current owner before forwarding renewal or unlock. Freeze local authority before sending a transfer, including when the receiver may have committed despite an RPC error. Retry without requiring a membership change, with backoff and shutdown cancellation. Recheck ownership after a background handoff and preserve the copy until the latest owner receives it. Replicate the effective installed expiry instead of a shorter transfer input. Replace timing assumptions with a same-key admission contention hook. Cover pre-handoff releases, lost acknowledgements, retry cleanup, owner changes, and effective expiry. Document why identityless legacy releases cannot safely delete slash-format leases with overlapping generation counters. * test(filer): set up DLM handoff before the peer lock transfer check Ring-change transfers now go through Dlm.TransferFn, which SetupDlmReplication installs; without it the lock stays pending on the old filer and the peer-auth transfer test cannot see it move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(lock_manager): bound the handoff and unlock completion waits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(filer): give the handoff retry expiry subtest a one-second lease Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(lock_manager): serve lock and unlock here when a handoff ends with this node as primary transferToOwnerLocked now returns the primary it observed after the handoff. LockWithTimeout and Unlock redirected to the primary read before the transfer, so a ring that moved back during the handoff sent the client away from the node that holds the lease. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(lock_manager): bound the admission probes in the handoff tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(filer): keep the holder's renew token while its lock handoff is pending A failed transfer RPC or a frozen lease answered the lock request with an error and an empty RenewToken. The client treats that as a rejection and drops its token, so it can no longer renew the lease once the handoff completes. Report transfer failures as LockHandoffPending and echo the caller's token for that error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(lock_manager): return lease expiry from Lock, Unlock and InsertLock The DLM was the only production caller of these methods and used private twins (lockWithExpiry, unlock, insertLock) to get the effective expiry. Return it from the public methods instead and drop the twins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(lock_manager): share the copy acceptance checks between InsertLock and InsertBackupLock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(lock_manager): drive handoff tests through TransferLockToOwner TransferLock and its helpers were only reachable from tests. Remove them so the tests exercise the production handoff path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(lock_manager): share the routing and handoff prologue of LockWithTimeout and Unlock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Master <Master@node0.8m510.lpad-pg0.utah.cloudlab.us> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
889af96779 |
mount: store a truncate through an open handle before answering (#13089)
* mount: store a truncate through an open handle before answering SetAttr with a new size and an open handle only marked the handle dirty, so the size reached the filer at the next flush or release. A mount that died before then brought the old size and data back, and an NFS export answered SETATTR, which no COMMIT follows, with a size it had not stored. Flush the handle once the entry locks are released, as a truncate without a handle saves the entry. The writeback cache still defers it, except under an NFS export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: test that a truncate through an open handle is stored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: refuse a truncate up past the quota before the file grows The size is now stored before SetAttr answers, so a growth the quota cannot take was installed and charged, then refused by the flush, leaving the grown size on the handle. Check the growth first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: compare a truncate's growth with the quota headroom The used size, the uncommitted writes and the growth were summed in int64, so a truncate up to near 2^63 wrapped the sum negative and passed the check. Take the growth as uint64 and compare it with what is left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6b2ad112a8 |
volume: check the collection name in handlers that build file paths from it (#13087)
* volume: check the collection name in handlers that build file paths from it AllocateVolume, VolumeMount, VolumeCopy and the EC rebuild, copy, delete, mount and to-volume handlers joined the request collection into volume file paths, so a collection such as "../x" reached files outside the volume directory. They now apply checkVolumeCollection, as CopyFile and ReceiveFile already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-volume: check the collection name in handlers that build file paths from it Mirrors the Go volume server: allocate_volume, volume_mount, volume_copy and the EC rebuild, copy, delete, mount and to-volume handlers apply check_volume_collection, as copy_file and receive_file already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: check the source's collection before VolumeCopy builds paths from it VolumeCopy names the destination files after the collection the source reports in ReadVolumeFileStatus, so that value needs the same check as the request's collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-volume: check the source's collection before volume_copy builds paths from it Mirrors the Go VolumeCopy: the collection the source reports in ReadVolumeFileStatus names the destination files, so it gets check_volume_collection too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: stub the source in the VolumeCopy source collection test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-volume: keep check_volume_collection's doc comment as on master Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
16412c374a |
test(filer): wait for the fake master's volume location in the manifest reuse tests (#13086)
The master client marks a master current as soon as the stream opens and applies the first VolumeLocation afterwards, so GetLocations right after GetMaster can miss volume 1 on a loaded runner. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
efcee4a186 |
test(volume_server): wait out a server's disk I/O before calling its SIGINT exit a hang (#13085)
* test(volume_server): wait out a server's disk I/O before calling its SIGINT exit a hang stopProcess gave every server 10s to exit after SIGINT. On a CI runner with a busy disk, the fsync in volume close can take longer than that: the server is in uninterruptible sleep, not hung. Sample the server's threads from /proc while waiting. Once one has been in D state, allow up to a minute. A server that never touched the disk still fails at 10s, and the failure now lists its threads' states and wait channels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(volume_server): wait for the sleep child before checking its stop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(volume_server): reap the SIGINT-ignoring child if it never starts sleeping Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e6aed012f8 |
filer: pass cutToSpan in the manifest reuse test (#13082)
ResolveChunkManifest gained a cutToSpan argument while this test was in flight, so master stopped compiling weed/server. The test compares chunk lists, so it resolves every referenced chunk. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4cf028f683 |
grafana: show the first EC shard copy failure of each series (#13071)
* grafana: count the failure that creates an EC shard copy failure series The EC shard copy failure counter exports a collection and reason pair only once a copy fails, so rate() saw that first value as a baseline and never showed it. The panel now shows failures per rate interval and adds the earliest value of a series that did not exist one interval ago. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * grafana: count a new EC shard copy failure series from its last value increase() extrapolates the increments of a series that appears inside the window, and an instant offset selector loses an old series across a scrape gap, so the panel could add a whole counter as new failures. A series with no sample in the day before the window now shows its last value; every other series shows increase(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * grafana: count the first EC shard copy failure after a restart A restarted volume server exports a failure series again only at its first failure, so when the same labels had a sample earlier in the day the window held only the new counter's samples and increase() missed that failure. A series whose lowest value in the window is below its last value before the window has been reset since, and now shows its last value; a series back from a scrape gap keeps its value and still uses increase(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a9fda6b50f |
filer clients: authenticate filer gRPC calls with per-call admin tokens (#13039)
* Add per-call filer authentication sources and pooled client wrappers * Authenticate gateway filer calls with per-call admin tokens * Authenticate shell admin and synchronization filer calls * Authenticate workers MQ and remaining filer client paths * Cache filer client signing keys and sign subscriptions with the shared key Re-reading security.toml on every filer RPC cost about 125us against 8us for signing. Keep the keys for up to a second, re-reading at once when a WEED_ override or the configuration directory changes. When the file exists but cannot be read, keep the last keys read, else the startup keys, as FilerAdminKeys does, so a process without a key stays tokenless. Metadata subscriptions prefer the shared key, as filer peers do, because older filers verify subscription admin tokens only with it. * Authenticate admin-script, maintenance and filer.conf shell paths Plugin worker admin scripts and master maintenance scripts build their own shell options and carried no filer token source; fs.configure and s3.bucket.quota.check read filer.conf without it. * filer.cat: report a failed read; isolate key overrides in the admin-script test filer.cat ignored the error from its filer call and exited successfully, leaving a truncated -output file. Report the error and exit with failure. The admin-script token test now clears the WEED_ signing-key overrides, which take precedence over security.toml. * security: refuse gRPC keys too short to sign; query engine uses client TLS Under GODEBUG=fips140=only, hmac.New panics on keys under 14 bytes. The startup check now covers jwt.filer_signing.grpc_key and grpc_previous_key, and filer client token sources check the keys they read, so a reloaded or per-endpoint security file with a short key is refused instead of panicking when the next RPC signs. The query engine's broker client dialed every master, filer and broker in plaintext, so the admin token it now sends could cross the network in the clear. It dials with the grpc.client TLS settings instead, and weed-sql loads security.toml as weed-db does. * security: per-endpoint admin tokens ignore WEED_ key overrides FilerAdminTokenFromFile honored WEED_JWT_FILER_SIGNING_GRPC_KEY and WEED_JWT_FILER_SIGNING_KEY. Those are process-wide, so filer.sync with -a.security and -b.security signed both clusters' admin tokens with the one key, handing each cluster a token valid on the other. A per-endpoint file now supplies its own keys only. * weed-sql, weed-db: refuse to start on an unreadable security.toml Both only warned when security.toml was present but could not be read or parsed. They then dialed without the grpc.client TLS settings while the filer token source could still sign admin tokens from WEED_ environment keys, so the tokens could travel in plaintext. They now exit with an error that does not quote the file; a missing file is still fine. * pb: take the filer token source in WithGrpcFilerClient and WithOneOfGrpcFilerClients Fold WithGrpcFilerClientAuth and WithOneOfGrpcFilerClientsAuth into the existing helpers instead of keeping two names for each. Callers without a token source pass nil. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: return the read error from ReadConfiguration Fold ReadConfigurationWithError into ReadConfiguration. The error is returned and not logged, since parser errors can quote values; the existing reload callers already warn when no file was read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: keep the test-only filerAdminToken helper in the test It had no production caller. The test helper now resolves keys through filerClientKeysFrom, as the token sources do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: read security.toml once in LoadSecurityConfigurationOrError It validated the file, then merged it with a second read whose failure was ignored and whose parser error was logged. It now merges with one read and logs nothing from the parser. Viper's search also treats a directory the process cannot search as holding no file; a candidate that cannot be checked for lack of permission is now refused too. * security: verify admin subscription tokens with the gRPC clock leeway CheckGrpcMetadataSubscription checked admin tokens strictly, while unary filer calls allow jwt.filer_signing.clock_leeway_seconds. With ten-second client admin tokens, a subscriber whose clock trailed the filer's by more than ten seconds was refused with a matching key. It now takes the leeway, and the filer passes its configured one. The leeway check moves from the server package to security.IsFilerAdminTokenWithLeeway so both use it. * util: start without security.toml only when every candidate is confirmed absent A candidate whose check fails for any reason other than not existing, such as a symlink loop, is refused like one the process cannot search. --------- Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f6b130f61c |
filer: keep a stored manifest when a commit lists its chunks flat (#13051)
* filer: keep a stored manifest when a commit lists its chunks flat Since #12462 the filer folds a commit's small chunks into manifests 256 at a time, whichever client sent them. A client that keeps its own chunk list sends every chunk it wrote on each flush and does not take the folded list back. The Hadoop client is one: SeaweedOutputStream's hflush and hsync send CreateEntry with the whole list, which the client folds itself only past 1000 chunks. Once 256 small chunks have piled up, each flush makes the filer fold the same chunks again into a new manifest blob, and the manifest of the entry it replaces is deleted: up to three manifests written and three deleted per flush. cleanupChunks now puts back, after compacting the list and before folding it, each manifest of the replaced entry whose chunks the list holds flat and unchanged (filer.ReuseStoredManifests). The manifest must span exactly the chunks it holds. A manifest the commit lists itself, one that cannot be read, one with a chunk changed or missing, and a hard-linked file's are left alone. MinusChunks counts the kept manifests as listed, so the commit does not delete them. That entry has to be the one the commit replaces and deletes against. UpdateEntry already prepares its chunks under the path lock from the entry it read there. CreateEntry folded before taking the lock; it now prepares the chunks under the lock, after its precondition checks, and reads the replaced entry there when the request has at least 256 chunks. filer.CreateEntry still deletes the chunks of the replaced entry that the new list drops, which no longer include the kept manifests. TestCommitKeepsTheStoredManifestOfChunksListedFlat (create and update): the second commit of the same list plus one chunk keeps the manifest, writes no blob and queues nothing for deletion. It fails on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: take the replaced entry in cleanupChunks instead of a cleanupChunksReplacing twin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: reuse a stored manifest only for its chunks listed in its order Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the stored entry's manifests out of a refused update's cleanup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: do not reuse a manifest whose chunk ties with a chunk outside it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: drop a pull request number from a reuse test comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: look up same-timestamp chunks by index in the manifest reuse overlap check The tie check rescanned the whole commit for every candidate manifest, so a 102,400-chunk commit with 400 matching manifests ran 40M map lookups under the path lock. Index the commit's positions by ModifiedTsNs once and check only the positions sharing a held chunk's timestamp. 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> |
||
|
|
3880e7ee5a |
volume(rs): keep the needle_not_found doc comment on its function (#13070)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c7fc40c76c |
filer, mount: read a manifest's chunks only within its span (#13048)
* filer, mount: read a manifest's chunks only within its span Until #13042, a truncate through a manifest only shortened the manifest chunk; the chunks it holds stayed whole. Reads resolve those chunks at their own offsets and sizes, so once such a file grows over the cut again without writing it, by an extending truncate or a write past the end, the cut bytes come back where zeros belong. #13042 keeps new truncates from leaving such manifests, but files a mount truncated between #12462 and #13042 still have them. Reproduced with weed mount on a local cluster: a mount from before #13042 appends 700 lines with one close() each, so the first 256 fold into a manifest, and truncates the file to 100 lines; a mount from current master then extends it past its old end with ftruncate. The extended range read 8,580 bytes of the cut lines instead of zeros, through that mount and through the filer. Reads now cut each manifest's chunks to the manifest's span: ResolveChunkManifestForRead, used by NonOverlappingVisibleIntervals (filer and S3 streaming, WebDAV, the mount's merge reads), the S3 ranged reads and the mount's peer reads, and ChunkGroup for the mount's reads. A manifest made by MaybeManifestize spans its chunks exactly, so only shortened ones change. ResolveChunkManifest still returns the chunks whole: MinusChunks, deletions and the other chunk-list comparisons need every chunk a manifest references, or the chunks past the cut would never be deleted. * sw-client: read a manifest's chunks only within its span Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: read a manifest's chunks only within its span Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: drop PR numbers from the manifest span comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: fold ResolveChunkManifestForRead into ResolveChunkManifest ResolveChunkManifest takes cutToSpan: the read paths pass true, the deletion and chunk-list comparison paths pass false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: cut manifests to their span when flattening an object's chunks A full-object SSE GET, CopyObject and UploadPartCopy flatten the source's manifests into a plain chunk list, which drops each manifest's span, so the chunks a truncate left past a shortened manifest came back as object data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: purge a volume.fsck path only for chunks within a manifest's span A chunk past a shortened manifest's span is still referenced but never read, so a missing volume under it loses nothing. The purge decision now uses the span-cut chunks while the inventory keeps every reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: cut manifests to their span in fs.distribute_chunks The entry is rewritten with the resolved chunks as a flat list or a new manifest that spans them, so chunks past a shortened manifest's span became readable again. The filer's update still deletes them, since it compares against the old entry's uncut chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: verify only the chunks within a manifest's span in fs.verify A chunk past a shortened manifest's span is never read, so a missing needle under it failed the entry and, with -pruneEntries, deleted a file whose readable bytes were intact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: mark the chunks past a manifest's span instead of allowing the visible ones The purge gate now skips only the resolved chunks that the span cut drops, so chunks that come from outside the manifests keep their purge behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: skip the purge for a missing past-span chunk on a listed volume volume.fsck -findMissingChunksInFiler queued a path for deletion when a listed volume's index lacked any chunk the uncut inventory recorded, including a chunk past a shortened manifest's span that no read reaches. Record those chunks per path during the filer walk and let only a missing chunk within the span queue the purge. The path is still reported. 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> |
||
|
|
c812a37c83 |
feat(grpc): serve grpc.health.v1 on every server, add health-check-only client certificates (#13049)
* feat(grpc): serve grpc.health.v1 on every server, add health-check-only client certificates
Every gRPC server built by pb.NewGrpcServer now answers the standard
grpc.health.v1.Health service, so blackbox_exporter's grpc prober,
grpc_health_probe and Kubernetes grpc probes can check SeaweedFS ports.
Check("") reports the server; Check(<service>) reports whether that
service is registered on the port.
grpc.health_check_commonNames lists client certificate common names that
pass the mTLS handshake on every component but may call only the health
service; any other RPC gets PermissionDenied. A monitoring probe can then
check the port and its certificate without a credential that opens the
whole gRPC API.
Fixes #5012
* seaweed-volume: serve grpc.health.v1 on the gRPC port
Mirrors pb.NewGrpcServer registering the health service on every Go
server: the whole server, the volume service and the health service
answer SERVING, other names NotFound.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* seaweed-volume: confine grpc.health_check_commonNames to the health service
Mirrors the Go healthCheckOnlyTap: a client certificate whose common name
is on [grpc] health_check_commonNames passes the handshake even when
allowed_commonNames is set, and any RPC outside grpc.health.v1.Health is
refused with PermissionDenied. WEED_GRPC_HEALTH_CHECK_COMMONNAMES
overrides the key like the other WEED_GRPC_ settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* seaweed-volume: end health watches when the gRPC server shuts down
Graceful shutdown waits for open streams, so a client holding a health
Watch kept the volume server from reaching store close. Clearing the
reported statuses ends every Watch stream once the shutdown signal fires.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pb: end health watches before gRPC graceful stop
GracefulStop waits on open streams, and Watch held its stream until the
client left, so a connected probe kept volume and admin worker shutdown
from finishing and made filer and S3 wait out their drain timeout.
StopHealthWatches ends those streams; every GracefulStop path calls it
first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* scaffold: point mTLS health probes at an exec probe
The built-in Kubernetes grpc probe sends no client certificate, so it
cannot pass an mTLS port; grpc_health_probe run as an exec probe can.
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>
|
||
|
|
6c54935723 |
java client, hdfs3: authenticate to a filer that requires filer JWT or Basic Auth (#13053)
* java client: read security.toml without an [https.client] section toml.getBoolean returns null for a missing key, so unboxing it threw a NullPointerException in the static initializer and every FilerClient failed with ExceptionInInitializerError when security.toml held only other sections, such as [grpc] or [jwt.filer_signing]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: sign filer JWTs and hold [filer.basic_auth] credentials FilerSecurityContext reads jwt.filer_signing.key, jwt.filer_signing.read.key (with their expires_after_seconds, defaulting to 10 and 60 like the Go clients) and [filer.basic_auth] from security.toml, with setters to set them in code. getFilerAuthorizationHeaderValue returns the credential for a request to the filer's HTTP port: an HS256 token for the access level, minted like security.GenJwtForFilerServer, else the filer Basic Auth, else the existing [basic_auth] value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: send the filer credential on filer-proxied chunk requests With volume server access through the filer proxy, chunk reads and writes address the filer's HTTP port, which checks the filer JWT or Basic Auth before proxying. The write sent the AssignVolume token instead, which the filer rejects with "wrong jwt", and reads sent no filer token. Send the filer credential on proxy URLs only; direct and publicUrl volume requests keep the volume token. With no filer credential configured, the old headers are sent unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: take filer JWT keys and Basic Auth from the Hadoop configuration fs.seaweed.filer.jwt.signing.key, fs.seaweed.filer.jwt.signing.read.key (and their expires.after.seconds) and fs.seaweed.filer.basic.auth.user / password override security.toml. The secrets are read with Configuration.getPassword, so a Hadoop credential provider can hold them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: document a filer secured with JWT or Basic Auth Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: fail a chunk fetch that answers a non-2xx status doFetchOneFullChunkData returned the response body whatever the status, so a 401 "wrong jwt" or a 404 JSON error was taken as chunk data and cached. Throw instead, so the fetch tries the next location and reports the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client, hdfs3: accept filer Basic Auth with an empty user The filer turns Basic Auth on whenever the password is set, user empty or not. The client dropped credentials without a user, so a password-only filer refused every proxied chunk request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: point the secured filer docs at [https.client] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client, hdfs3: keep filer credentials on each filer client The filer JWT keys and [filer.basic_auth] lived in process-wide fields, so a second filesystem with its own fs.seaweed.filer.* options replaced the credentials of the first one, and a filesystem without options inherited the previous overrides. Each FilerClient now copies the security.toml values into its own FilerCredentials, and chunk reads and uploads use the credentials of the client that issued them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: let each filer credential option override only its own value A password-only or token-lifetime-only option in core-site.xml was ignored or dropped the security.toml user and key. Each option now replaces just the security.toml value it names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: show [https.client] for a secured filer and per-option overrides Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: note that [https.client] does not check the filer host name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: check filer tokens against the configured key and lifetime Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: do not follow redirects on filer proxy chunk requests HttpClient copies the request's Authorization header onto a followed redirect, even to another origin, so a relayed 3xx would hand the filer JWT or Basic credential to the redirect target. A 3xx now fails like any other non-2xx answer and the read moves to the next location. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: close the filer client when credential options fail A credential provider error or a malformed lifetime option threw out of the store constructor after the client had opened its gRPC channels, leaving them open on every failed initialization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hdfs3: say the filer HTTP credentials apply only to filerProxy mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * java client: pick filer credentials by access mode and filer address The proxy check matched any URL containing proxyChunkId=, so a volume url or publicUrl carrying that text would receive the filer JWT or Basic credential. Only filerProxy-mode URLs that start with this client's own filer proxy prefix count as filer requests now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
50ac729a71 |
filer: fold only runs of small chunks that lie end to end (#13041)
* filer: fold only runs of small chunks that lie end to end #12462 folds every chunk under 1 MiB into manifests, 256 at a time in list order. Two things go wrong when those chunks are not plain appends: - A manifest's chunks are not compacted again. A small chunk that a later write covers stays stored and referenced after the write hid it. - weed mount's bloat check sums chunk sizes and counts a manifest by its span. A manifest over chunks that are not next to each other spans bytes other chunks hold, so the file looks bloated and the flush reads it back and stores it again, whole. With weed mount on a local cluster, a writer that appends 300-byte records and rewrites a 4 KiB header at the front after each one (open, two pwrites, close): after 766 records the mount logged "2.0x chunk bloat detected ... (2 chunks, 475684 stored vs 233896 content), merging" and rewrote the file, and did it again at 2.5x (1164184 stored vs 463396 content); 1,600 records cost two whole-file rewrites. Each rewrite reads and stores the whole file, and the next one comes a few hundred flushes later. Random small writes fold their overwritten pages the same way. Only small chunks that no other chunk overlaps now fold, and only in runs that lie end to end, so a manifest spans exactly the bytes it holds. Appends make such runs and fold as before. Chunks between full-size ones, chunks that overlap others and chunks with a hole between them stay flat, as they did before #12462. What is left of a run stays flat until the run grows. * filer: size the small-chunk fold's result by its input CodeQL alert 446 (go/allocation-size-overflow) flagged the capacity len(inputChunks)-len(folded)+len(manifests). It cannot overflow, but the input's length bounds the result anyway: each manifest takes the place of SmallChunkManifestBatch chunks. |
||
|
|
40a95a8ef5 |
admin: filter plugin jobs and activities by volume id (#13077)
* admin: keep the volume id on tracked plugin jobs Volume-scoped jobs carry their volume in the volume_id parameter, but the in-memory job list drops parameters, so nothing could select a volume's jobs without reading every job detail file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: filter plugin jobs and activities by volume id /api/plugin/jobs and /api/plugin/activities accept volume_id, applied before the limit like the lane filter. Activities follow the tracked jobs of that volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: volume id filter on the plugin monitor A Volume ID box next to the execution state filter narrows the queue, execution jobs and activities to that volume's jobs, fetched with the volume_id API filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep detection scans visible under the volume filter Detection activities belong to no job, so the volume-filtered activity window had none of them and the Detection Jobs table went empty. That table now reads its own job-type window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: accept zero-padded volume ids in the monitor filter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: drop a monitor refresh that finishes after a newer one Two refreshes of the same scope can finish out of order; the older one then replaced the newer rows, with empty lists when its volume-filtered fetch failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep rows committed for the scope when a plugin monitor refresh fails A failed request fell back to the rows captured when the refresh started, so a refresh overlapping one that had already committed the new scope's rows cleared them. Resolve the fallback when the refresh commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: validate the monitor volume id before fetching Out-of-range ids went to the APIs and came back 400. The filter is now applied only from a valid change event, so the periodic refresh no longer reads a value still being typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: volume id filter on the job queue view The queue renders the volume-scoped rows, but the only filter box sat on the execution view, so an active filter was invisible and could not be cleared there. Both views now carry a box kept in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: reject unparsable volume id text instead of clearing the filter A number input holding text like "1e" reports an empty value with validity.badInput set; treat it as invalid rather than as a cleared box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ec34160a1a |
master, admin: report the real last heartbeat time of volume servers (#13074)
* master: report each volume server's last heartbeat time DataNode.LastSeen only moves when a volume server registers, so nothing recorded when the master last heard from it. Stamp every processed heartbeat and carry it in DataNodeInfo.last_heartbeat_ns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: show the master's last heartbeat time for volume servers The volume server details reported the admin's own clock as the last heartbeat. Use the time the master reports, and show unknown when the master does not report one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: carry the last heartbeat time into the volume servers page GetClusterVolumeServers builds its records from the master's volume list without the topology conversion, so the details dialog showed unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
df98e9df3e |
admin: wait for the failed record in the worker-restart orphan test (#13079)
handleJobCompleted hands the completion to the dispatcher before it updates the tracked job, so the test could read the record while it still said assigned. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2e81c0b7c0 |
filer: route a rename whose source misses locally to the write owner (#13064)
* filer.proto: mark a forwarded StreamRenameEntry with is_moved Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: send a rename whose source misses locally to the write owner Exclusive and conditional creates are stored on the path's write owner. With separate filer stores, a rename sent to another filer before it has replayed the create found no source and failed, so a mount that flushed a deferred create and renamed the file right after got EIO. Such a rename now goes to the source's write owner, which moves the entry and whose events are relayed to the caller, unless the owner runs on this filer's store. A forwarded rename is applied only by the filer its own ring names as the owner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: send an AtomicRenameEntry whose source misses locally to the write owner The same race reaches the unary rename that S3, WebDAV, SFTP and fs.mv use: an object or file created through the owner and renamed through another filer before replication found no source. It is forwarded like the stream rename, with is_moved bounding it to one hop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rename: report a missing source as ENOENT A rename whose source is absent fails with the store's "no entry is found" error, which neither the filer's errno mapping nor the mount's message mapping recognized, so the client got EIO instead of ENOENT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer.proto: report a forwarded AtomicRenameEntry's last event position Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: answer a forwarded rename once the owner's events are replayed here The rename's target is stored on the owner only until this filer replays it, so an unlink of that name sent here right after the rename would miss it and report success. The owner now reports the log position of the rename's last event, and the forwarding filer holds its answer (bounded) until its stream from the owner has delivered that far. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: refuse a forwarded no-replace rename over a target this filer has Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: wait for an owner this filer no longer follows before answering a forwarded rename PeersCaughtUpTo counts an untracked peer as caught up. An owner whose stream was down long enough to be dropped has replayed nothing here, so a forwarded rename answered then could leave a follow-up unlink through this filer missing the target. Require the owner to be tracked with a watermark at or past the rename, still bounded by ownerEventsCatchUpCap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
96fd7fe6e2 |
volume: report mounted EC shards whose file on disk is gone, replaced or resized (#13069)
* volume: report mounted EC shards whose file on disk is gone, replaced or resized
Each EC heartbeat tick stats every mounted shard file and compares it with the
open descriptor: a missing path or a different file is a ghost, a size other
than the mounted one is stale_size. Mismatches are logged per shard and counted
in SeaweedFS_volumeServer_ec_shard_disk_mismatch{reason}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): report mounted EC shards whose file on disk is gone, replaced or resized
Mirror of the Go check: each EC heartbeat tick compares every mounted shard
with its file (missing or another inode = ghost, other size = stale_size),
warns per shard and sets SeaweedFS_volumeServer_ec_shard_disk_mismatch{reason}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* metrics: chart EC shards that disagree with their file on disk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): tell a replaced EC shard file apart on non-unix hosts
Without inode numbers, compare the creation and modification times of the
path and of the open handle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: check mounted EC shards off the heartbeat loop
A stat stuck on a stalled disk no longer holds up heartbeats or shutdown; at
most one check runs at a time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): check mounted EC shards off the heartbeat loop
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): compare file ids to tell a replaced EC shard file apart on Windows
Timestamps can match on a replacement file. Use the volume serial and
file index from GetFileInformationByHandle there, and dev/inode on
unix, the same identity Go's os.SameFile compares.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): copy mounted EC shard state out before checking the disk
The check held the store read guard across its file system calls, so a
stalled disk kept the guard and a waiting writer could then stall the
heartbeat's own read. Copy each shard's path, size and file id under
the guard and check them after it is released. The id is recorded when
the shard opens, so no extra handle is held for the check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): run the EC shard disk check on a detached thread
Dropping the runtime waits for spawn_blocking tasks, so a stat stuck on
a hung disk could hold up shutdown. A plain thread is not waited on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): stat the EC shard path instead of opening it
A replacement the server cannot read failed the open and was never
counted as a ghost. Compare device, inode and length from the path's
metadata, as the Go side does with os.Stat; on Windows open it with no
access rights.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): test the EC tick past a stalled disk check
The check thread start takes the check to run, so a test can stall one
after its snapshot and show that a writer still gets the store, the tick
still reports, and no second check starts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: keep VolumeServer int64 counters 8-byte aligned on 32-bit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
8ab78a9a06 |
s3: return part checksums in ListParts (#13076)
* s3: return part checksums in ListParts UploadPart stores the part's checksum on the part entry and returns it, but ListParts built each Part from the SDK type, which has no CRC64NVME field, and never filled the checksum fields. List each part with its stored checksum so a client can verify an uploaded part after losing the UploadPart response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: name the upload's checksum algorithm and type in ListParts CreateMultipartUpload records the requested checksum algorithm and type on the upload, but ListParts never reported them. Return both, as AWS does, when the upload was created with a checksum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2ce8b75b3f |
ci: refresh the apt index before installing musl and cross toolchains (#13075)
The runner image's package index can name versions the mirrors have already dropped, so apt-get install fails with a 404 on the first security update after the image was built. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
b53f6d4b5e |
admin: warn when more than one scheduler runs the same maintenance work (#13065)
* admin/maintenance: report whether the running manager queues a task type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: list the EC balancers that are active at the same time The plugin ec_balance job, the legacy maintenance manager's ec_balance task and an admin_script job that runs ec.balance -apply each plan shard moves from the same topology without knowing about the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: log a warning while more than one EC balancer is active The check runs on the maintenance metrics tick and logs again only when the set of active balancers changes. The legacy maintenance entry names the admin.toml switch that turns it off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: warn on the plugin pages when more than one EC balancer is active The scheduler status API returns the active EC balancers, and the scheduler banner on the plugin and lane pages lists them when there are two or more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin/maintenance: count a task type only when a registered worker can run it Only legacy maintenance workers pull tasks from the legacy queue. With plugin workers alone, the queued ec_balance tasks never run, so they do not compete with the plugin ec_balance job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: parse ec.balance apply flags like the flag package A value counts only when strconv.ParseBool reads it as true, and a # token ends the arguments, as it does for the shell command's flag parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin/maintenance: skip legacy workers past their heartbeat timeout A disconnected worker keeps its queue record until the cleanup loop removes it, so the capability check also requires a heartbeat within the worker timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: count ec.balance only when its flags parse the way the command parses them An invalid boolean in -apply or -force fails the whole command, the last value of a flag wins, -force overrides -apply, and parsing stops at the first non-flag argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: share ec.balance's flag set and report whether its arguments apply the plan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: count an admin_script ec.balance only when ec.balance accepts its flags Unknown flags and invalid values of any flag fail the command before it can move shards, so they no longer count as an active balancer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell, plugin/worker: move admin_script command tokenizing into the shell package Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: split admin_script ec.balance arguments with the executor's tokenizer A quoted value with spaces is one argument to ec.balance, so flags after it are still seen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: report through one lookup whether a command's arguments change the cluster ec.balance now also rejects an invalid -volumeIds, as its Do does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: report whether volume.balance arguments apply its plan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: report whether ec.encode accepts its arguments ec.encode has no dry run, so any accepted invocation changes the cluster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: report whether volume.vacuum accepts its arguments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: report overlap for every maintenance work that more than one scheduler runs The plugin scheduler, the legacy maintenance manager, and an admin_script can each run volume balance, EC balance, EC encoding, and vacuum. Check all four from one table and report each work with two or more active runners, in the log and in the scheduler-status API as maintenance_overlaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: show each maintenance overlap on the plugin pages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1e4739f97a |
s3api: count object reads that fail after the status line is sent (#13073)
* s3api: count object reads that fail after the status line is sent
A GET whose body breaks after the 200/206 was committed is recorded by
SeaweedFS_s3_request_total as a success and only shows up in the log.
SeaweedFS_s3_read_aborted_total{bucket,cause} counts these reads on the
volume-server, SSE and remote-mount stream paths, split into
client_canceled, deadline_exceeded and read_error, and is dropped with
the other per-bucket series when a bucket is deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: plot aborted S3 reads by bucket and cause
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: count aborted reads of inline objects and directory content
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: count gRPC deadline failures as deadline_exceeded aborted reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* s3api: count an aborted read as client_canceled only when its request was canceled
A context.Canceled error under a live request context comes from an
internal cancellation, such as a shared lookup canceled by another
request, so it is recorded as read_error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
ef633dcc4d |
admin: inspect an S3 object's versions, retention and chunk volume health (#13078)
* admin: inspect an S3 object's versions, retention and chunk volumes For a bucket and key, collect the base entry and every entry under <key>.versions, decode version id, delete marker, ETag, client checksum, Object Lock mode, retain-until, legal hold and the WORM enforcement time, and map each chunk to its volume. One filtered VolumeList then reports, per volume, replicas present versus the replica placement, or the EC shards present and missing against the data shard count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: serve the S3 object inspection at /api/s3/buckets/{bucket}/objects/inspect Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: add an Inspect Object page for a bucket and key /object-store/buckets/{bucket}/inspect?key= renders the inspection: volume health per chunk volume with a link to the volume or EC volume page, then every version with size, mtime, ETag, client checksum, lock mode, retain-until, legal hold, WORM time and its chunk file ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: link each bucket to the object inspector Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: inspect a key that is also a prefix of other keys The filer keeps such an object on a directory entry marked as a prefix object, so the base entry lookup must accept it like a file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: count only S3 version entries as an object's history A sibling named <key>.versions is history only when it is a directory, and only children with a version id (attribute or v_ file name, as VersionIdFromEntry reads them) are versions. Without a base object or any such version the inspection is not found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: mark the newest version latest when the pointer is missing When the base object is gone and .versions has no latest pointer (for example after deleting a current null version), pick the latest with the S3 gateway's own version ordering, exported as SelectLatestVersionId, instead of leaving every version noncurrent. A truncated listing marks none, since it may not hold the newest version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: report the ETag the S3 gateway returns Use objectETag, exported as ObjectETag, so remote-only entries show their remote ETag and entries without a stored ETag or MD5 show the chunk-derived one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: read the buckets path with the inspection's request context Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: report the filer's logical size for each inspected version filer.FileSize also covers chunk extents past a stale attribute size and a newer remote size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: drop EC shard state once a volume also reports a replica Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: let the latest-version pointer outrank the null-is-latest flag Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: page the inspector's version scan past non-version entries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: judge an inspected EC volume by its newest encode run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ebe5c8ac91 | docs: regenerate star history chart | ||
|
|
46fe0f10da |
volume: count failed EC shard copies by reason (#13068)
* volume: count failed EC shard copies by reason
Each failed VolumeEcShardsCopy now increments
SeaweedFS_volumeServer_ec_shard_copy_failures_total{collection,reason} and
logs the volume, shards, source and reason. Reasons: source_not_found,
empty_index, no_space, timeout, io_error, other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* grafana: chart EC shard copy failures by reason
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): count failed EC shard copies by reason
Mirrors the Go volume server: each failed VolumeEcShardsCopy increments
SeaweedFS_volumeServer_ec_shard_copy_failures_total{collection,reason}
with the same reasons and logs the volume, shards, source and reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: classify wrapped gRPC NotFound and DeadlineExceeded copy errors
A source status that the destination wraps as text keeps its code only as
"code = NotFound" (Go) or the code's description (Rust), so match those
too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): record EC copy failures inside the copy task
The copy keeps running after the caller cancels, so its failure is
reported from the spawned task; a join error is reported by the handler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
b6237dd8b1 |
master, admin, shell: warn about volume servers left in the default data center or rack (#13066)
* master: warn when a volume server registers in the default data center or rack A volume server started without -dataCenter or -rack lands in DefaultDataCenter/DefaultRack. Next to servers with explicit placement it becomes its own failure domain for placement and balancing. Log a warning when such a server registers while other servers name their data center, or other racks of the same data center are named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: warn about volume servers left in the default data center or rack The Volume Servers page lists the servers that fell back to DefaultDataCenter or DefaultRack while other servers name theirs, with their volume and EC shard counts, so the stray failure domain shows up before placement and balancing act on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: cluster.check warns about volume servers in the default data center or rack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: cluster.check prints placement warnings before the capacity checks A disk type with no free slots made cluster.check return before the default data center/rack warnings were printed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: list each data center's rack once in the default placement check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8df718eaf3 |
build(deps): bump actions/dependency-review-action from 5.0.0 to 5.0.1 (#12929)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/a1d282b36b6f3519aa1f3fc636f609c47dddb294...bbc44d14a204704ccc493733616cd1e93a0321ec) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-version: 5.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
76bc731c69 |
feat: s3: record object path in needle Content-Location pair (#13061)
* feat: operation: pass needle pairs through chunked uploads (#12997) * feat: s3: build Content-Location needle pair from the object path (#12997) * feat: s3: record object path in needles written by putToFiler (#12997) * feat: s3: record destination object path in copied chunks (#12997) * feat: s3: record destination object path in stream-copied chunks (#12997) * test: s3: pin Content-Location in putToFiler upload options (#12997) * s3: record no path on copies of volume-encrypted chunks A chunk written with -encryptVolumeData is copied as ciphertext through the plain upload path, so the copy sent the destination path in plaintext next to encrypted data, while PutObject's cipher upload sends no pairs at all. 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> |