mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
58cdda773a7b8a6cb3fe829e01facddbdb98e7fa
16361
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
58cdda773a |
filer: test an append on a store that keeps FileSize as given
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
18911b1a48 |
filer: start an append at the entry's full size
A store that keeps the entry as given can return FileSize zero beside chunks, so the append chunks were placed at offset zero over the existing bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4051ef469f |
filer: test an offset write on a store that keeps FileSize as given
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
845deb4693 |
filer: route fsync appends to the owner with the fsync flag
A fsync append on a non-owner committed locally without a condition, so it could still overwrite a write the owner committed after its re-read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f0928124ec |
filer: carry a create's fsync request in CreateEntryRequest
The per-request fsync is a context mark on the receiving filer, so a create forwarded to another filer lost it. CreateEntry now applies the request's fsync flag to its store write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
b8d652cc10 |
filer: normalize the stored entry too when matching IF_ENTRY_EQUAL
A store that keeps the entry as given (the JSON-backed ones) returns FileSize zero beside chunks, while the expected entry was normalized to the chunk extent, so an unchanged entry failed the match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a72323d202 |
filer: keep fsync appends on the local commit
A per-request fsync is a local context mark that a forwarded CreateEntry cannot carry, so the owner would store the append without flushing. Storage-rule fsync is still applied on the owner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
af08337006 |
filer: keep the chunks of a forwarded append whose outcome is unknown
The owner may have committed before its reply was lost, and with separate per-filer stores the local lookup may not see that commit yet, so deleting the chunks it does not find can strip a committed append. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ce70eaed69 |
filer: test an HTTP append racing another filer's append
Two filers on one store share a two-member ring. An append on the non-owner gets another filer's append injected at the store after each of its reads of the entry in turn; it must either keep both appends or be refused. Without the routed conditional commit, injections after the re-read are overwritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1759ae311a |
filer: commit an HTTP append on a non-owner through the entry's owner
An HTTP append or offset write re-read the entry under its path lock and cluster lock and then committed with an unconditional upsert. The path lock is per process and the cluster lock is a lease, so with several filers on one store a write landing between the re-read and the upsert was overwritten although both requests were acknowledged. A filer that is not the entry's write owner now sends the commit to the owner as a CreateEntry conditioned on the entry it read (IF_ENTRY_EQUAL, absent when there was none), evaluated under the owner's path lock. The owner keeps committing locally under that same lock. A failed condition refuses the append as a changed entry; any other routed error keeps the uploaded chunks the stored entry references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4c92a00357 |
admin/plugin: detect again soon after a capacity give-up (#12825)
A scheduled run whose jobs no executor can take gives them up at once, leaving them to the next detection. For a job type with a long detection interval that is a whole interval later: a daily job whose only worker was briefly full lost a day. Bring the job type's next detection forward to within 10 minutes when its jobs are given up for capacity, never pushing back an earlier one. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi |
||
|
|
1d7125abf2 |
filer: keep AppendToEntry's cluster lock for the whole append (#12819)
* filer: renew AppendToEntry's cluster lock while the append runs AppendToEntry took a 5 s short-lived lock and never renewed it, so an append slower than that (slow store, slow volume, GC pause) lost the lock while still running, and another filer could take it and append to the same entry concurrently, dropping one append's chunks. Use the auto-renewing lock the HTTP append path already uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: refuse an AppendToEntry commit once its cluster lock was lost A renewal can still fail, or the lock can be lost and granted again under a new generation, while the append runs; another filer may have appended in between. Check the lock and its generation right before the entry is written, fail the append so the caller retries, and drop the manifest chunks this attempt created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * cluster: IsLocked reports a lock whose lease ran out as not held isLocked only flipped when a renewal came back rejected, a second after the reply, so a holder whose renewal stalled past the lease (a long GC pause) still read as locked while the server could hand the key to someone else. Track the lease from each grant's send time and require it in IsLocked, which the filer append paths check before committing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: hold the slow-append test past the renewing lock's first lease The renewing lock grants a 7 s lease, so a 6 s hold passed even with renewal off; wait past LiveLockTTL so only a renewal keeps the lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: say the AppendToEntry lock check is best effort Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6018f87c25 |
test(s3vectors): add an author-filter workload to the perf suite (#12818)
* test(s3vectors): let a perf test restart the engine with extra environment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * test(s3vectors): serve the volume server's metrics in the test cluster Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * test(s3vectors): build a named index in the perf suite through one helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * test(s3vectors): add an author-filter workload to the perf suite Plants authors at 10%, 1%, 0.01%, fewer than topK and no rows (seed 5), scattered over the index or written as consecutive keys, and reports the eligible rows, p50/p95, filtered recall@k against an exact numpy search over the eligible rows, results per query, hits without a finite distance, and the engine and volume server read counters, warm or with the engine's caches at 0 MB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * test(s3vectors): reject duplicate hits and clean up a failed filter workload setup The workload skips the distributed cluster, since only one engine is restarted, and accepts only the warm and cold modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4bbc03747f |
s3vectors: match json_extract's escaping of control characters in filter strings (#12817)
* s3vectors: render filter string control characters as serde_json does
json_extract serializes the stored value with serde_json: \b, \f, \n,
\r, \t, \u00XX for the rest of U+0000-U+001F, and U+007F-U+009F raw.
The scalar comparison text used Rust debug escapes (\0, \u{1}, \u{7f}),
so $eq/$in on such strings missed scalar values and $ne/$nin kept them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* test(s3vectors): filter on every control character, quote and backslash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
e109f91c6f |
vector: indexed metadata keys, engine side (derive, rewrite, exact planner, filter counter) (#12813)
* vector: derive the indexed metadata key columns An indexed metadata key is a hidden `_mk_<n>` column of List<Utf8>: the strings an S3 `$eq` on a string matches, that is the value when it is a string or the string elements of an array, and nothing for any other type or a missing key. The field metadata names the key and its state (`building` or `ready`). The module derives the column from metadata given as JSON (the write path) or as stored (jsonb or JSON text, for a backfill), and reads the indexed keys from a schema. It lives in the worker crate so the engine and the worker share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: fill the indexed metadata key columns on PutVectors PutVectors builds its batch against the table's current schema. Once a table has indexed metadata key columns, the three-column batch no longer matches that schema and the write fails. Fill each `_mk_*` column the schema has from the row's metadata, whatever the key's state; a column the engine does not know still fails the request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: answer string $eq and $in on a ready indexed key from its column The gateway renders a string `$eq` or `$in` on a key as an OR of `json_extract(metadata, P) = '"v"'` (or IN) and `json_array_contains(metadata, P, '"v"')` over the same values. On the parsed filter, a top-level conjunct of that shape on a key whose column is `ready` becomes `array_has` / `array_has_any` on the column, which its LABEL_LIST index answers. The two halves must name the same key and the same strings, the scalar half in the text json_extract returns for them; anything else, including `$ne`, `$nin`, `$exists`, numbers and booleans, stays on the JSON path, and the other conjuncts still apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: score few indexed matches exactly, per scope With a ready indexed key in the filter, `ann` first counts the rows of its scope that the key's conjuncts match, through the scalar index. When they are at most the limit it scores them exactly over that scope, the way the short-result fallback does; above it, the vector index searches with the indexed prefilter, and the fallback still applies. The scope is the one `exact_in_scope` scores, so per-scope exact answers merge into the global exact top-k. The limit is `Query::exact_match_limit` (None takes 256; 0 never counts), set by the engine's --exact-match-limit (WEED_VECTOR_EXACT_MATCH_LIMIT). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: count filtered queries by metadata key For each index, the engine counts its QueryVectors calls by the metadata keys of the parsed filter, with their total latency and the operand types each key was compared with, over the last hour in 5-minute buckets. At most 512 indexes and 32 keys per index are kept (an idle key makes room; otherwise the index is marked truncated), and the stats are not exported as metrics labels. The new FilterStats RPC returns an index's stats; the gateway's discovery client forwards it like the other calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: report the metadata columns capability in gRPC health An engine whose writes fill the indexed metadata key columns reports the gRPC health service `weed.vector.capability.metadata_columns` as serving, so an operator action can refuse to index a key while an older engine could still write the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: expire filter stats' operand kinds and truncation with the window The operand kinds a key was compared with, and the mark that a key went uncounted, outlived the queries that set them. Keep the kinds per 5-minute bucket and the truncation as the bucket it last happened in, so both leave the hour window with the counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: fill indexed key columns a write left empty racing their add A PutVectors that opened the table before an indexed key's column was added, and commits after the add, is rebased by Lance onto the wider schema: it commits, and the rows it wrote hold NULL in the new column, so the column's index misses them (reproduced in the test: 100 of 150 rows). After its commit, PutVectors now looks for indexed-key columns the batch did not carry, reads those of its keys whose column is still NULL, derives the values from their stored metadata and patches just those columns with a partial-schema merge that updates only rows still NULL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: keep filter stats' truncation mark at the later bucket record() reads the clock before it takes the lock, so a call that waited on the lock across a bucket boundary could move the truncation mark (and the index's last-used bucket) back to its earlier bucket, and the mark then left the window one bucket early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * vector: derive a raced write's indexed key columns from current metadata A PutVectors that opened the table before an indexed key's column was added is retried by Lance against the wider schema: rows it inserts hold NULL there, and rows it updates keep the value derived from their old metadata, which the NULL-only heal never looked at. The heal now derives the columns for all of the write's keys. Its merge also ran with Lance's retry, which joins the values derived before the conflict onto the rows a later write of the same keys left. It now fails on a conflict and is redone from the latest version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * vector: check the raced write's keys keep the later write's rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
817338c911 |
volume.merge, volume tail receiver: apply size-0 records for existing keys as deletes (#12816)
* volume: apply a tailed size-0 record as a delete when the key exists A delete and an empty write both reach the tail receiver as a size-0 .dat record. Writing every one as a live needle turned each delete caught by volume.move's tail into a 200-empty object. Treat the record as a delete when the key already has a record on the receiver, and as an empty write otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rust volume: apply a tailed size-0 record as a delete when the key exists Mirrors the Go tail receiver: a size-0 record for a key that already has a record here is a delete, otherwise an empty write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: volume.merge applies a size-0 record as a delete when the key exists The tail stream carries deletes as size-0 records, and volume.merge wrote each one to the merged copy as a live empty needle, so every delete in the volume came back as a 200-empty object on all replicas. A size-0 record for a key already written in the merged stream is now a delete on the target; for a new key it stays an empty write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: volume.merge reads a size-0 record as a delete only after its own replica's record Replicas append the same write at their own times, so a fresh empty write can reach the merge twice when the copies are further apart than the dedup window. Tracking keys across all replicas made the second copy a delete. Track, per source replica, the keys it has returned (duplicates the merge skips included): a size-0 record is a delete only when its own replica wrote the key before, which is the only way a replica appends a delete. A delete for a key the merged copy already deleted sends nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: volume.merge verification counts the deletes the merge applied Applying deletes lets a correct merge hold fewer live needles than a replica that missed a delete, and the live-count check then refused it and kept the divergent replicas. Every key live on a replica is either live or deleted in the merged copy, so compare that replica's live count with the merged live count plus the keys the merge deleted. An empty merged copy is still refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: tail receiver looks a size-0 record's key up in the needle map The receiver read the needle to decide whether a size-0 record deletes an existing key. A read reports a needle past its TTL as not found, so a delete for it was written as a live empty needle, which reads ignore TTL for. Look the key up in the needle map instead (Volume.LookupNeedle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * rust volume: tail receiver looks a size-0 record's key up in the needle map Mirror Go: write_tailed_needle read the needle to decide whether a size-0 record deletes an existing key, and a read reports a needle past its TTL as not found, so the delete became a live empty needle. Look the key up in the needle map instead (Volume::lookup_needle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: volume.merge keeps a merged delete when a late empty copy follows A replica that missed a delete can hold its copy of the empty write stamped after the other replica's delete. As that replica's first record for the key it was written, reviving the deleted key. A size-0 record now never revives a key the merged copy already deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: volume.merge refuses more replicas than its key history has bits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0a1e337302 |
wdclient: keep a volume's live replicas readable while another volume cannot be found (#12814)
* wdclient: keep a volume's live replicas readable while another volume cannot be found A filer's "volume not found" answer counted as a filer failure, so three of them opened the circuit breaker on a healthy filer. With its only filer in the cool-down, every lookup then failed without asking, as "all 1 filer(s) failed with non-retryable error: %!w(<nil>)". And a refresh whose lookup failed left the cache without the volume's live replicas, since InvalidateCache had already dropped them with the dead one. The breaker now counts only failures to reach the filer, and asks the filers anyway when all of them are in their cool-down. InvalidateCache keeps what it removed; a lookup that errors puts it back unless the volume was learned again, the epoch moved, or a reset would have expired it, and leaves out locations fenced by a pushed removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: set invalidated locations aside in the map instead of copying them out The first commit kept what InvalidateCache removed in a side map and put it back when the lookup failed. The copy left the map's lock, so a removal the master pushed between the take and the put-back was undone: the removed server came back into the cache. The entry now stays in the map with a state. entryStale hides it from readers and releases its server references, as a delete did. A pushed removal edits it like any other entry. When the lookup after the invalidation returns an error, the entry becomes entryRevived and is served again. A stale or revived entry holds only what was known before the read failed, so the next thing learned replaces it: a lookup answer drops it before the answer is cached, including an answer with no locations and an answer to a lookup that was in flight when another one failed, and a pushed add replaces it instead of merging. LookupVolumeIdsWithFallback returns no error when every volume it was asked for has locations after the revive, so the filer's LookupVolume handler sends its response instead of an error status. The not-found breaker test now checks the failure count itself. Without that, a regression of the classification passed, because a lone filer in its cool-down is asked anyway. On the first commit, TestPushedRemovalRacingFailedRefreshes failed in 8 of 8 runs under -race: four with "got [live:8080 old:8080], want [live:8080]", four with "got [], want [live:8080]". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * wdclient: retry a filer lookup pass that asked no filer The pass decides once whether to skip unhealthy filers. A filer whose breaker trips after that decision, as when a concurrent lookup records its failure, is still skipped. With every filer skipped the pass ended with no error and failed the lookup as non-retryable with "%!w(<nil>)". Such a pass now counts as Unavailable, so the lookup retries and the next pass asks the filers anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: believe a provider answer that reports errors for some volumes The master provider answers a batch with a map of the volumes it knows and an error naming the ones it does not. The failed-lookup branch took that as no answer and revived what InvalidateCache had set aside, so a volume the master reported as absent came back with its old locations, and the batch could return them with a nil error. Only a nil map now means no answer. Otherwise the answer replaces what was set aside, and the provider's error is still returned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: keep set-aside locations learned after a lookup was asked A successful lookup dropped every stale or revived entry of the volumes it asked for, however old the answer was. A lookup asked before the master confirmed new locations could, on finishing, delete those locations after a read had set them aside and a failed refresh had revived them, and its own answer was not cached because the epoch had moved. Entries now record when their locations were learned, and an answer drops only what was learned before it was asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: keep an older answer from replacing locations set aside after it was asked |
||
|
|
374c77bcbe |
admin/plugin: fail a restored job its worker no longer lists (#12815)
* admin/plugin: fail a restored job its worker no longer lists An admin restart reloads the jobs that were running from the persisted state, but the workers drop those jobs when the old admin stream closes. No pending execution covers a restored job, so only the 24h stale sweep ended it, and until then it blocked dedupe and scheduling of its job type. Track the active jobs loaded at startup by worker and fail one after two itemized heartbeats from its worker leave it out, as is already done for a dispatch whose worker restarted. A listed job is left to adoption. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: keep tracking a listed restored job; skip queued ones - A restored job its worker lists only resets its miss count, so one it drops later is still failed. - Track only jobs that were sent to a worker (request id set, not pending). - Match restored ids against the trimmed heartbeat ids. - Fail the restored attempt under the jobs lock that applies the expiry (handleJobCompletedIf / expireActiveJobIf), so a newer attempt of the same job is neither failed nor canceled. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: keep a newer attempt's detail from a restored-job expiry - The conditional completion writes the job detail through persistJobDetailSnapshotIf and skips it when the stored detail already names another request; the check runs under jobDetailsMu with the write. - mergeTerminalDetailIntoTracked ignores a terminal detail of another request, so a restart does not end the loaded attempt with it. - Tests wait for the restored-job expiries instead of sleeping. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: restore a finished retry from its detail The job detail is saved as each attempt changes and the job list only periodically, so a terminal detail naming another request is the newer attempt. Apply it with its request id instead of ignoring it; the expiry's own detail write already refuses to overwrite another request. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: restore whichever attempt is newer The job list and a job's detail can name different attempts either way round: the list is saved periodically, and a detail write can fail. When their request ids differ, apply the terminal detail only if it is the newer attempt (higher attempt number, else later update). Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: fill a restored job's empty request id from its detail A job the list saved while still queued has no request id; take the finished detail's, as the merge did before the newer-attempt check. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: take the worker and attempt of a newer restored detail When the restore takes a finished retry's detail over the job list's attempt, the record kept the older attempt's worker and attempt number next to the retry's request id and state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin/plugin: fold the conditional completion into the existing functions handleJobCompleted, expireActiveJob, trackExecutionCompletion and persistJobDetailSnapshot take the accept check themselves instead of gaining *If twins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin/plugin: ignore a late earlier-attempt completion; replace an older detail - A completion whose request id differs from the tracked attempt's is a late report of an earlier attempt and no longer ends a retry. - A conditional completion skips the detail write only when the stored detail is a newer attempt (detailIsNewerAttempt), so an older finished attempt's detail left behind by a failed write is replaced. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: take only the dispatched attempt's reports A late progress report of a timed-out attempt replaced the retry's request id, after which the retry's own completion was rejected as foreign. One rule now gates both: a record the admin dispatched (attempt > 0) takes progress and completion only for its own request (reportFromOtherAttempt). When an expiry replaces an older attempt's detail it also takes the closing attempt's worker, attempt number and times. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: restore a newer running attempt's identity from its detail The job list can name attempt A while the detail shows retry B running when the admin stopped. The restore now takes B's request id, worker and attempt number from such a newer running detail, so B's own reports are accepted. Test helper keeps a given attempt number. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin/plugin: keep attemptEnded's doc comment on attemptEnded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin/plugin: dispatch an attempt-less job as attempt 1 The late-report guard only covers records with a positive attempt, and ExecuteJob passed a zero attempt through, so a direct caller's dispatch could be closed by another request's completion. The HTTP API already raised zero to one; the dispatch path now does the same for every caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2382f07788 |
filer: keep a hard-linked file's chunks when one of its names is replaced (#12812)
* filer: keep a hard-linked file's chunks when one of its names is replaced Replacing one name of a hard-linked file deleted the file's chunks while its other names still pointed at them. Reads through those names then return EIO once the volumes are vacuumed; until then they only work through readDeleted. Two everyday ways to get there through a mount: - conda links an environment's files to its package cache with hard links. Python saves a __pycache__/*.pyc by writing a temporary file and renaming it over the old name, so the cache's copy loses its data. - A training script saves model.pt, hard-links it into an epoch directory and saves the next epoch by renaming a new file over model.pt. Each archived epoch loses its data. Three write paths deleted the chunks of the entry they replaced without asking whether that entry was one of several hard links: - a rename over a file: moveSelfEntry drops the target's link, then queues all of the target's chunks for deletion; - CreateEntry over an existing path (an S3 PUT, for one): the update drops the old entry's link, then deleteChunksIfNotNew deletes its chunks, and the CreateEntry handler deletes chunks its own list covers; - UpdateEntry with an entry that no longer carries the old one's link. A plain delete already keeps the chunks while HardLinkCounter > 1, and a folder delete asks hardLinkIsOrphaned. The three paths now go through Filer.KeepHardLinkedChunks, which asks after the write, once the replaced name's link is gone: the chunks stay unless the file's shared record went with it, that is, unless the replaced name was the last link. Writing the file through one of its names (an entry with the same hard link id) still deletes the chunks the write replaced, since every name reads the new content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep hard-linked chunks from the shared record, not the replaced row A lookup that cannot read the hard link record returns the name's own row, which can lag the file. Read the record when filtering the garbage, and keep everything when it cannot be read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test the manifest reads behind KeepHardLinkedChunks The manifest resolution moves into withoutChunksOf, which takes the lookup function, so tests can serve manifests. Chunks behind nested manifests and the manifests themselves stay, unrelated garbage is still deleted, and an unreadable manifest returns an error, on which KeepHardLinkedChunks deletes nothing. Behavior is unchanged. 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> |
||
|
|
a91def90c0 |
volume: count and log needles vacuum drops as unreadable (#12811)
* volume: count needles vacuum drops as unreadable and log each at error level Vacuum drops a live needle whose record fails to read back intact (CRC mismatch, malformed fields, short or dangling record). The key leaves the compacted index with no tombstone, so repair tools later treat it as a vacuumed delete. Log every dropped key at error level and count the drops in SeaweedFS_volumeServer_vacuuming_dropped_needles per collection, once the compacted index is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * grafana: add a panel for needles dropped by vacuum Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * seaweed-volume: count needles vacuum drops as unreadable and log each at error level Mirror the Go volume server: log every dropped key at error level and add SeaweedFS_volumeServer_vacuuming_dropped_needles per collection once the compacted index is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: count dropped needles only after the compacted dat is flushed The final .cpd fsync runs in the deferred close and loadTmpNeedleMap can still fail after the index is saved; a copy failing there is retried and would count the same needles again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2ac8db5cb4 |
filer: lock the path for plain HTTP overwrites so replaced chunks get deleted (#12801)
* filer: lock the path for plain HTTP overwrites CreateEntry looks up the entry it replaces and queues that entry's chunks for deletion. Two plain PUT/POST writes of one path could both read the same old entry, so the chunks of whichever write lost were never queued. Take the exclusive path lock around CreateEntry, as the gRPC CreateEntry already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test concurrent HTTP overwrites queue every replaced chunk Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ac7d949c61 |
filer: keep a manifest needle until its data chunks are queued for deletion (#12810)
* filer: resolve deleted manifests through the master on a volume cache miss Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a manifest needle until its sub-chunks are queued for deletion When a manifest could not be read during chunk deletion, the manifest needle was deleted anyway and the data chunks it listed were orphaned. Retry the resolve with the deletion retry backoff and delete the manifest alone only after MaxRetryAttempts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a durable delete that joins a pending manifest retry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: bound each manifest retry read with a deadline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: requeue resolved manifest ids on an fsync upgrade instead of rereading A durable delete that joins a manifest retry in flight used to resolve the manifest a second time, but the first pass had already queued the manifest needle, so the reread could fail and the sub-chunks never got the durable mark. Resolve nested manifests up front and queue the same ids again with fsync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: bound each manifest retry pass and stop it on shutdown A pass takes ready manifests one at a time and stops after manifestRetryTimeout, leaving the rest queued for the next tick, so a run of stalled reads cannot keep the shared retry loop from ordinary deletion retries or from noticing shutdown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8df716b728 |
volume: make a delete retry after a failed replica fan-out reach the replicas (#12797)
* http: report the status of a failed delete that has no body A replica that answers a DELETE with a bare 500 left the forwarding server reporting "[<replica>]: " with an empty reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: forward a delete retry that finds nothing here to the replicas A delete is applied locally before it is sent to the other replicas, so when the fan-out fails the client is told to retry while this replica already dropped the needle. The retry then read nothing here and answered 404 without asking the replicas, so the replica that missed the delete kept the needle for good. On a replicated volume, a plain delete that finds the needle missing or deleted now cancels a write still queued for it, as a replica delete does, and sends the delete on to the other replicas. A failed fan-out is reported as before, so the client retries until every replica agrees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): take a replica's 404 to a forwarded delete as done A replica that no longer holds the needle answers a forwarded delete with 404. The Go server folds that into success, but the Rust server reported it as a replication failure, so a delete that only had to catch up one replica failed on the replica that was already in step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): forward a delete retry that finds nothing here to the replicas Mirrors the Go server: on a replicated volume, a plain delete that finds the needle missing or deleted cancels a write still queued for it and sends the delete on to the other replicas, so a retry after a failed fan-out reaches the replica that kept the needle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume: answer a delete whose needle read fails with 500, not 404 A replica's 404 to a forwarded delete is taken as the needle being gone there. DeleteHandler answered 404 for any failed pre-read, so a replica whose disk could not read the needle let the primary acknowledge a delete that replica never applied. Only a missing or deleted needle (or a volume this server does not hold) answers 404 now; other read errors are a 500, so the client retries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): answer a delete whose needle read fails with 500, not 404 Mirrors the Go server: a replica's 404 to a forwarded delete is taken as the needle being gone there, so only a missing or deleted needle answers 404; other read errors are a 500 and the client retries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): corrupt the needle with portable file writes in the delete read test FileExt::write_all_at is Unix-only, so the test did not build on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2e4be5e25e | mount: report a read-only mount root that does not exist as not found, not as the create error (#12799) | ||
|
|
f2acfb7be4 |
volume: serve decoded bytes for a range over a compressed needle (Go and Rust) (#12805)
* volume: serve decoded bytes for a range over a compressed needle A Range with Accept-Encoding: gzip got Content-Encoding: gzip and a slice of the compressed bytes, which a decoding client cannot read. The range is over the stored file's decoded bytes, so pass gzip through only for a whole read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * seaweed-volume: serve decoded bytes for a range over a compressed needle Mirrors the Go volume server: a Range with Accept-Encoding: gzip got Content-Encoding: gzip and a slice of the compressed bytes. Pass gzip through only for a whole read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * seaweed-volume: HEAD of a compressed needle reports the served length HEAD answered a compressed needle from its meta: the stored gzip length with no Content-Encoding, whatever the request accepted. Go reads the payload and reports what the GET would send: the decoded length, or the gzip length with Content-Encoding: gzip for a whole read that accepts gzip. Read a compressed needle in full on HEAD too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * test/volume_server: range and HEAD over a compressed needle Both volume servers serve a gzip-accepted range decoded, and HEAD reports the length the matching GET would send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * seaweed-volume: decode every gzip member of a compressed needle Go's gzip reader reads concatenated members; GzDecoder stopped after the first, so a range over such a needle saw a shorter body and length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
b5f23b7dbf |
vector: answer a short filtered ANN query by an exact scan (#12802)
* vector: answer a short filtered ANN query by an exact scan A prefiltered query through the IVF index sees only the partitions it probes. When those hold fewer than k eligible rows the answer is short (400 matches, topK 500, 63 partitions: about 208 returned), and when at most k rows match Lance appends the ones its probes missed with an infinite distance. Either case is now answered again by an exact scan of the same scope: the listed fragments plus the live coverage of the listed index segments, or the whole table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * vector: count an explicit probe count as indexed only with an index With nprobes set on a table that has no vector index, the scan was marked indexed, so a filtered query matching fewer than k rows ran the same exact scan a second time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
261c534c19 |
filer: retry TiKV store writes on a write conflict (#12798)
* filer: retry TiKV store writes on a write conflict TiKV transactions are optimistic. A commit fails with a write conflict when another transaction committed one of its keys after it began, even for a blind Set or Delete. Outside a filer transaction the TiKV store runs each save and delete in a transaction of its own and returned that error to the caller, so of two requests writing the same entry at the same moment one failed, and a mount reported EIO. A write the store commits itself (InsertEntry, UpdateEntry, DeleteEntry, one batch of DeleteFolderChildren, KvPut, KvDelete) now runs again in a new transaction after a write conflict, up to 5 times, waiting 1-2ms, 2-4ms, ... 16-32ms in between. The failed transaction stored nothing, and the retry lands after the other writer, as if the two had not overlapped. The retries stop when the context is done. A write inside a transaction from BeginTransaction is not retried: the conflict is reported when the caller commits, as before. deleteBatch now goes through RunInTxn like the other writes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * filer: stop TiKV write retries once the context is done When the context was cancelled while the retry wait was running, the timer case could still win the select and start one more transaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a TiKV entry that is no longer expired when listing deletes it The listing decides an entry has expired from its own read, and the delete ran later as a blind delete. Once the delete retries after a write conflict, a live replacement committed in between was removed. Read the entry again in the deleting transaction and delete it only if it is still expired. 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> |
||
|
|
5e003bae7d | docs: regenerate star history chart | ||
|
|
4ac3633f1c |
volume: check the needle id in the streamed-read probe and on blob writes (#12794)
* storage: reject a streamed read whose record id or size differs The header probe before a streamed read returned not-found only when both the record's id and its size differed from the index entry, so a record of another needle with the same size passed and its data was streamed under the requested key until the final checksum check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: refuse a needle blob whose header names another needle WriteNeedleBlob compared only the blob header's size with the size it was asked to index. A blob read from an offset that has since moved to another record of the same size was appended and indexed under the wrong key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): refuse a needle blob whose header names another needle Mirror of the Go check: write_needle_blob_and_index compared only the blob header's size, so a blob of another needle with the same size was appended and indexed under the requested key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): report not-found when a streamed read's record is another needle The meta read ahead of a streamed reply took the id from the record header without comparing it with the requested key. Return not-found when the index entry resolves to another needle, as the Go header probe does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: check the requested id after a meta-only read ReadNeedleMeta overwrites n.Id with the record's header id, so a meta-only read through an index entry that resolves to another needle returned that needle's metadata, and the streamed-read probe that follows compared the record with itself. Return not-found when the header names another needle, as the Rust meta read does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: copy a needle blob to another volume, not under another key WriteNeedleBlob now refuses a blob whose header names another needle, so the round trip writes the blob under its own id into a second volume and checks that storing it under another key is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: compare the streamed header with a deleted entry's record size A deleted index entry stores the negated size, so a read-deleted stream compared the positive header size with a negative one and missed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4a5dbe4c6f |
storage: copy an empty needle written during compaction in makeupDiff (#12796)
* storage: copy an empty needle written during compaction in makeupDiff A size-0 index row is a live empty needle, not a delete. makeupDiff grouped it with tombstones and appended a made-up delete marker, so the compacted .dat lost the record's cookie and held a delete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): copy an empty needle written during compaction in makeup_diff A size-0 index row is a live empty needle. makeup_diff wrote a made-up delete marker and a tombstone row for it, so the needle read as not found after the commit. Copy the record like any other live row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: fail makeupDiff when the replayed needle write fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * volume(rs): check the compacted empty needle's id and cookie in the test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ba1bfa816c |
admin: show a pruned job's detail from its run record (#12795)
* admin: show a pruned job's detail from its run record Tracking keeps the newest 1000 jobs across all job types and deletes the details of older finished ones, while each job type's run history keeps its last 10 successful and 10 failed runs. A job listed in the run history could therefore open as "job detail not found". Fall back to the run record when the job is no longer tracked. Claude-Session: https://claude.ai/code/session_011UpvafcfUuC2mLxNAXLQJi * admin: show 100% progress for a pruned successful run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: use the newest run record for a job across both outcomes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep the run record a pruned job's detail was built from Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: keep looking for a run record past an unreadable history Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: pick a pruned job's newest run record across job types Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
be8ebc2e04 |
storage: build the temporary needle map in CompactByVolumeData (#12788)
* storage: red test for CommitCompact after CompactByVolumeData with a concurrent write or delete Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: build the temporary needle map in CompactByVolumeData Fixes #12783 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: require a successful commit in the CompactByVolumeData commit test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bfbeed61a7 |
storage: read only the header and trailer in the append-time search (#12791)
BinarySearchByAppendAtNs, its left/right probes and ResumeByLastEntry read every probed record through readNeedleAt, which parsed the whole body and verified the data checksum, although they use only the id, cookie, size and append time. One record with damaged data on the search path, even a needle deleted long ago, failed the search and with it the tail sender, a timestamp-based incremental copy and the volume.move catch-up. readNeedleAt now reads the header and the trailer and skips the data. The data checksum is still verified where the data is read, including the tail receiver for every record it gets. The Rust volume server already parses only the metadata on this path and does not verify the data checksum. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
05427e8108 |
storage: hold the data-file read lock across the append-time search (#12789)
* storage: red test for the append-time search racing a vacuum commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: hold the data-file read lock across the append-time search Fixes #12785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: Version() writes the superblock version only when it changes Version() stored the .vif version into SuperBlock.Version on every call, so each call was a write that raced with readers of the superblock that do not take superBlockAccessLock, such as the append-time search and the compaction setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: harden the append-time search race test; add a lock-hold budget test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * storage: Linux-only lock budget; stop before reading search failures 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> |
||
|
|
f7323f2b63 |
filer: optional HTTP Basic Auth on the filer HTTP ports (#12778)
* security: add a constant-time HTTP Basic Auth check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: require HTTP Basic Auth on the HTTP ports when configured With filer.basic_auth.password set in security.toml (or WEED_FILER_BASIC_AUTH_PASSWORD), a request on the filer HTTP ports, TUS included, must carry those credentials or a valid filer JWT, and an access level with no JWT signing key is no longer open. Valid Basic credentials grant read and write. 401 responses then carry a Basic challenge so browsers prompt. The credentials reload on SIGHUP with the signing keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * scaffold: document filer.basic_auth in security.toml Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: enable reloaded Basic Auth before swapping the JWT keys Reload cleared the old signing keys before storing the new Basic credentials, so a switch from JWT to Basic Auth briefly left both off and admitted anonymous requests. Store new credentials first and clear old ones last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: refuse Basic credentials on cross-origin browser requests Browsers resend cached Basic credentials on requests other websites trigger, such as a form POST with mv.from, and the default cors.allowed_origins "*" lets them through. Accept Basic credentials only on requests without an Origin, from the filer's own host, or from an origin explicitly listed in cors.allowed_origins. A JWT is still accepted from any origin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: recheck Basic Auth after reading an empty signing key A request that loaded Basic Auth as off, then read the signing key after a JWT-to-Basic Reload had cleared it, was let through anonymously. Open access now also needs Basic Auth to be off after the key read; with Reload enabling the new credential before disabling the old one, the two loads cannot both miss a credential that was on throughout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: compare Basic Auth credentials as MACs under a per-process key A plain SHA-256 of the password is what password-hash scanners flag; keying the digests with a random per-process HMAC key keeps the length-independent constant-time compare without holding one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: read a configuration file without merging into the shared viper LoadConfiguration merges each read into the shared viper, so a key removed from the file keeps its old value after a reload. ReadConfiguration reads the file into a fresh viper with the same search path and WEED_ environment overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: turn Basic Auth off when security.toml no longer sets it The shared viper merges each SIGHUP reload into what it held, so removing [filer.basic_auth] kept the old password valid. Read the credentials from security.toml alone at startup and on reload; an unreadable file keeps the current setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep Basic Auth when security.toml cannot be read A malformed file at startup dropped a WEED_FILER_BASIC_AUTH_PASSWORD from the environment, and viper reports an unsearchable config directory as a missing file, which turned Basic Auth off on reload. ReadConfiguration now always returns the environment overrides and reports whether the file was read; a reload that could not read it keeps the current credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep reloading Basic Auth from the security.toml first read A search directory that turned unsearchable made viper fall through to a lower-priority security.toml, and a reload from a file without [filer.basic_auth] turned Basic Auth off. ReadConfiguration now takes the file to read, and the filer reads the file it first found on every reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f5e091cf91 |
wdclient, s3: return an embedded S3 gateway to its local filer after failover (#12772)
* wdclient: sort newly discovered filers and log every current-filer switch Discovery appended new filers in map iteration order, so after the current filer left, the fallback at index 0 was a random filer. Append them sorted. Route every change of the current filer through one helper that logs it at V(0) with its reason (failover, return_home, discovery), so an operator can see which filer a gateway uses without new metrics. * wdclient: prefer a home filer and return to it after failover with backoff A FilerClient with FilerClientOption.HomeFiler set goes back to that filer once its circuit breaker allows a re-check, instead of staying on whichever peer it failed over to. Leaving home again soon after a return doubles the wait before the next return, up to 5 minutes; a return that holds for 10 minutes resets it. Volume lookups and discovery follow the same preference. * s3: embedded gateway uses its local filer as home filer weed filer -s3, weed server -s3 and weed mini now build the gateway's filer address in the form the filer registers in the master (ip:port.grpcPort), with the gRPC port default applied, and pass it to the gateway as its home filer, so the gateway returns to its local filer after any failover. Standalone weed s3 has no home filer and behaves as before. Refs #12768, follow-up to #12771 * wdclient: switch the current filer only from the filer a request started on A volume lookup that started on a peer and finished after the client had returned home moved it back to the peer and counted that as leaving home, doubling the return backoff although home never failed. Concurrent failovers could also each count as a separate departure. Failovers now name the filer they started on and take effect only while it is still current, via compare-and-swap, so only the winning switch logs and feeds the backoff. S3's failover walk uses the same rule. * wdclient: switch the current filer and record the return backoff in one step The index moved by compare-and-swap before the switch was recorded, and both ran under the shared read lock. A request reading the current filer in that gap saw the peer with the old eligibility time and, with home's breaker still closed after one failure, switched straight back home. The eligibility check, the move and the bookkeeping now all run under homeMu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: discovery falls back past a home that is still backing off When discovery removed the current filer and home was not yet eligible, the client took index 0, which is home whenever it is listed first. With home's breaker still closed after a single failure, requests went back to the filer they had just left. Take the next filer instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: start return timing on every switch back to the home filer Only a return_home switch stamped lastReturnHome. Discovery or a peer's failover could also put the client back on home, and a failure soon after such a return kept the backoff at its base value instead of doubling it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Konstantin Lebedev <whitefox@mayflower.work> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c9f3a02b94 |
filer: recover a leveldb store whose table a power loss damaged (#12780)
* filer: recover leveldb without rebuilding broken tables leveldb.Recover rebuilds a table with damaged blocks using the user comparer and filter on internal keys. The shortened index keys it writes are not valid internal keys, so a Get on the rebuilt table panics, and the bloom filter it writes misses every lookup. Recover with a comparer that keeps full index keys (same name, so the manifest still matches) and no filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: recover a leveldb store when a compaction finds a corrupted table When a compaction reads a damaged table block, as a power loss can leave one, goleveldb latches the corruption error and returns it for every later write until the database is reopened. A plain reopen loads the same table and the next compaction fails again, so the store kept rejecting inserts even across restarts. Treat a corruption error from a write like a storage error, and reopen through leveldb.Recover, which rebuilds the table without the damaged blocks, then retry the write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: rebuild damaged leveldb tables before Recover leveldb.Recover's own table rebuild orders internal keys with the user comparer, so a damaged table holding several versions of one key fails with "keys are not in increasing order" and the recovery gives up. Overriding the comparer cannot fix that, because the same comparer also serves the recovered database's user keys. Rebuild every table that has corrupted blocks first, using an internal key comparer and full index keys, then let Recover rebuild the manifest from tables it no longer needs to rewrite. Seed the test tables from a journal flush so they keep several versions of a key, and check keys the write test does not rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: leave unreadable leveldb tables for Recover to drop table.NewReader reports a truncated table or a damaged footer through the reader, not its error, so rebuildDamagedTables never stopped on one, but it rewrote it as an empty table first. Skip tables with nothing readable and let Recover drop them, and test an unreadable table next to a healthy one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: let StrictRecovery drop damaged leveldb tables With StrictRecovery set, leveldb.Recover drops a table that has corrupted blocks. Salvaging the readable blocks first would hide the damage from it, so skip the rebuild under that option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: hold the leveldb storage lock while rebuilding tables The table rebuild ran after the failed open released the storage lock and before Recover took it, so it could rewrite the tables of a database another caller had open on the same storage. Take the lock for the rebuild; Recover takes it again afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6bdcd17ed4 |
master: reject an assign on a follower as Unavailable (#12779)
* master: reject an assign on a follower as Unavailable Assign on a master that is not the raft leader returned raft.NotLeaderError as a plain error, which reaches gRPC clients as codes.Unknown. operation.Assign retries only Unavailable, ResourceExhausted, Canceled and DeadlineExceeded, so every assign made during a leader election failed at once instead of waiting for the new leader. Return it as codes.Unavailable, like the warming-up status in the same file, so clients retry within their 30 s assign budget. The message is unchanged, so callers that match "Not current leader" still work. StreamAssign now answers such a request in-band with the error message instead of ending the stream, as it already does for warm-up. TestAssignOnFollowerIsUnavailable covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * pb: keep the cached channel when the peer answers Unavailable with details gRPC's own Unavailable (dial failure, closing transport) never carries details, so one that does came from the peer over a working channel. Closing the shared ClientConn for it cancels every other in-flight RPC on it with "the client connection is closing". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * master: tag the follower's assign rejection with a NOT_LEADER ErrorInfo The detail marks it as the master's answer, so clients retry it without tearing down their cached channel to that master. 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> |
||
|
|
729b872f01 |
test: let the merge-read FUSE test wait out the master's vacuum drain (#12777)
* test: let the merge-read vacuum outlast the master's write drain Before compacting a volume the master waits up to 30 s for writes it assigned to that volume to drain. The test cut each /vol/vacuum call at 30 s and gave the vacuum 60 s, so one or two slow drains failed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: retry the merge-read vacuum until the master runs one A 409 means another vacuum holds the master's lock; check the chunks only after a vacuum this test asked for has finished. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
972f85159e |
util/http: probe dead replicas in the background and key no-answer dials by machine (#12776)
* util/http: probe an unanswering server in the background, not on a read Once the retry interval passed, the first read put the dead server first and waited out the full dial timeout before trying a live replica. Keep it last and dial it from a background probe with a short timeout instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: try every server of a machine that does not answer last Unreachability was kept per host:port, so a powered-off node running one volume server per disk cost one stalled read per server before each was known dead. A dial that times out or finds no route now marks the whole machine; a refused connection still marks only that port and shows the machine is up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: probe an unanswering server with an HTTP request A bare TCP connect cleared servers that accept connections but never send response headers, and could not dial an address without an explicit port. Probe with a HEAD request through the global client instead, and have the tests wait for the probe to settle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: keep a timed-out port last after a sibling port answers A dial timeout stored only the machine verdict, so a success on another port of that machine cleared it and the port that timed out went back to the front. Record the port as well as the machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: classify refused and unroutable dials with Winsock errnos on Windows Windows reports these as WSAECONNREFUSED, WSAEHOSTUNREACH and friends, which errors.Is does not match against the syscall constants. Test the refusal with a real dial to a closed port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: wait for background probes through a WaitGroup in tests A refused probe can finish before the test reads the claimed record, so inferring completion from the record's timestamp could wait out the deadline on a probe that already settled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: key machine verdicts apart from hosts without a port A host without an explicit port is also its machine name, so a sibling port answering cleared the timed-out host along with the machine verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util/http: group a bracketed port-less IPv6 host with its machine net.SplitHostPort rejects "[2001:db8::9]", so the machine key kept the brackets and missed the verdict stored for "[2001:db8::9]:9501". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ed7324611c |
filer: metrics for metadata subscription delivery (lag, holds, ring fall-offs, claim and watermark ages) (#12773)
* filer: metrics for metadata subscription delivery (lag, holds, ring fall-offs, claim and watermark ages) * filer: measure subscribe delivery lag after the real send using the mutation stamp, and record a watermark hold once per hold * filer: skip empty progress markers when sampling subscribe delivery lag * filer: assert subscribe delivery lag is sampled only after the stream send succeeds * grafana: panels for the metadata subscription delivery metrics Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: record a watermark hold when the read passes the held entry, not when the next hold starts * filer: use a monotonic clock for the subscribe hold duration --------- Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
05a1463855 |
wdclient: keep the embedded S3 gateway on its local filer across discovery (#12771)
* filer: keep an explicit gRPC port in the embedded gateways' filer address runFiler handed the embedded S3/WebDAV/IAM/SFTP gateways NewServerAddress(...).String(), and String() drops the .grpcPort part. With a non-default -port.grpc the gateways then dialed port+10000 and did not recognize their own filer in the master's list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wdclient: match discovered filers by gRPC address A filer listed as host:port and the same filer discovered as host:port.grpcPort were compared as raw strings, so a refresh pruned the configured filer, added every discovered filer as new in map order, and reset the current filer to whichever came first; a pushed join added it a second time. Key filers by their gRPC address: a survivor keeps its health and current position and takes the discovered address form, and pushed joins and leaves match the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c1c95e127f |
filer: scoped read-only tokens for metadata subscriptions (#12767)
* security: scoped read-only token for filer metadata subscriptions A token signed with jwt.filer_signing.subscribe.key names the subscribe methods and the path prefixes its holder may see. mTLS peers and admin tokens stay unrestricted. Internal subscribers attach an admin token when both keys are configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: enforce subscription token scope on metadata streams With jwt.filer_signing.subscribe.key set, SubscribeMetadata and SubscribeLocalMetadata authorize the caller first. A scoped caller gets a stream that sends only events whose paths are all under its prefixes, filters batches, and never carries log file refs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: send an admin token on internal metadata subscriptions Peer filers, metadata followers and the lifecycle reader attach an admin token when the subscribe key is configured, so they keep the full stream without mTLS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: add fs.meta.token to mint metadata subscription tokens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: end scoped metadata subscriptions at token expiry The scope now carries the token's exp. The scoped stream's context ends at that time and the call returns Unauthenticated, so an open stream no longer outlives its token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer.sync: sign metadata subscriptions with the source cluster's key MetadataFollowOption takes a FilerJwtProvider; filer.sync passes the one loaded from -a.security or -b.security, so clusters with different admin keys both accept the subscription. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: report fs.meta.token flag errors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: give scoped metadata subscribers their own client id A scoped caller could reuse another subscriber's ClientId with a higher epoch and replace that registration, disconnecting it. Scoped streams now register under a server-chosen id that no other subscriber holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: accept only HS256 metadata subscription tokens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * security: test HS384 metadata subscription token rejection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: never let a scoped subscriber replace another registration The server-chosen id can be taken by another subscriber between choosing and registering it. Registering scoped streams with the lowest epoch makes addClient refuse them rather than replace the other registration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: send position markers for events a scoped token withholds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test a scoped stream withholding a whole event batch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: filter SendMsg on scoped metadata streams The scoped wrappers only overrode Send, so a SendMsg on the embedded stream would reach the client unfiltered. Route it through the same filter and refuse any other message type. Ported from #12790. Co-authored-by: mindaeon <30555587+mindaeon@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test a scoped subscription through the real subscribe loop Run SubscribeLocalMetadata with a scoped token over a flushed backlog, the in-memory tail and live events: only in-scope events arrive, sibling, "..", encoded and cross-boundary rename paths are dropped, and no log file references are sent although the client asks for them. Without the subscribe key every event still arrives. Ported from #12790. Co-authored-by: mindaeon <30555587+mindaeon@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: test that the HTTP API refuses metadata subscription tokens GET, HEAD, PUT, POST and DELETE all refuse a subscription token, also when the subscribe key equals the read or write key. Ported from #12790. Co-authored-by: mindaeon <30555587+mindaeon@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: mindaeon <30555587+mindaeon@users.noreply.github.com> |
||
|
|
668ca45029 |
s3: ListParts returns each part number once, its latest attempt (#12770)
* s3: list each part number once, its latest attempt Every UploadPart writes its own NNNN_<uuid>.part entry, so a part number uploaded twice listed twice, superseded ETag included, and a max-parts page could hold only the stale attempt. ListParts now groups the entries by part number, reports the attempt sortEntriesByLatestChunk ranks first (the same order completion uses), and pages over distinct part numbers, reading past a page boundary that splits one part number's attempts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: test ListParts over repeated part attempts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: rank an empty part attempt by commit stamp or mtime An empty UploadPart body stores no chunks, so sortEntriesByLatestChunk gave it time zero and an empty re-upload always lost to the attempt it replaced. Attempts now rank by the filer's commit stamp when both carry one, else by the later of the first chunk's write time and the entry mtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: keep only the newest attempt per part while listing parts listPartAttempts held every attempt of a part number until the page was built, so a heavily retried part grew one ListParts request's memory past what max-parts bounds. It now compares each entry against the newest seen for its part number with compareLatestPartAttempt, the comparator sortEntriesByLatestChunk sorts with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: order part attempts by commit stamp, then attempt time Comparing commit stamps only when both attempts carried one made the order non-transitive across stamped and unstamped attempts, so listing and completion could pick different attempts depending on input order. The commit stamp now leads (unstamped entries predate the field) and the attempt time breaks ties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: list part 10000 after the four-digit part numbers Part names sort as text, so 10000_<uuid>.part lands between 1000.part and 1000_<uuid>.part. A page could end on part 10000 and the next marker then skipped parts 1000-9999, and a legacy 1000.part could be reported before the newer attempt of part 1000 was read. List the four-digit part numbers first and part 10000 in its own prefix listing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: test ListParts paging across part 10000 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
dcbea0626f |
test/s3: patch s3-fast-list's data map race in the listing study build (#12766)
test/s3: build s3-fast-list with its data map draining the last page The data map task reads the channel and then the list-task state. When the list task sends its last page and completes between the two reads, the map is dumped without that page and the tool exits 0, so a one-page prefix comes back empty. Read the state before the channel. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
de4075660f |
telemetry: refresh the server module's go.mod so the integration test builds (#12765)
* telemetry: refresh the server module to the root module's dependency versions The server module replaces seaweedfs with ../.., so root dependency bumps raised prometheus/common, prometheus/procfs and x/sys past the versions its go.mod listed, and go build refused to run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: run the telemetry integration test on root go.mod changes The telemetry server module builds against the root module through a replace directive, so a root dependency bump can leave its go.mod stale without touching telemetry/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
652133a28a |
telemetry: keep the newest release in the versions chart (#12764)
The versions chart keeps the 8 versions with the most clusters on the last day and folds the rest into "other". A new release starts small, so 4.54 (282 clusters) was folded in while 4.53 shrank as clusters upgraded, which showed as a dip across the named versions. The newest plain release now always keeps its own band. Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e012fca9a2 |
mount: keep lookups from stalling behind directory cache rebuilds (#12754)
* mount: release the meta cache lock between batches of a rebuild wipe deleteFolderChildrenForRebuild held mc's write lock while it listed every cached child of the directory and deleted them. Every metadata read in the mount (FindEntry, IsNameFresh, isOversized) takes the read lock, and a waiting writer blocks new readers, so while a large directory was wiped, lookups and getattrs in unrelated directories queued behind the scan. The scan gets slower as leveldb accumulates the deletion markers of earlier wipes of the same directory, which happens quickly once lookups rebuild expired directories. Wipe rebuildWipeBatchSize (1024) children per lock hold and drop the lock between batches. A child is judged pinned under the same lock that deletes it, so a local-only create is kept whether it was pinned before the wipe started or between batches. The listing that refills the directory already ran outside the lock, so batching adds no interleaving the build did not allow. Add LevelDBStore.BatchDeleteEntries, the counterpart of BatchInsertEntries. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: bound how long a lookup waits on the directory rebuild it starts Since #11268 a lookup whose parent's cache expired rebuilds the parent and every expired ancestor up to the mount root before it answers, and every lookup beneath them joins the same builds. With a slow listing (a large directory, a busy filer, or the meta cache lock held by another rebuild) a plain stat, an ls -l, or the parent touch after mkdir waited for all of it. Wait at most lookupRebuildTimeout (2s), then fall back to one LookupEntry RPC. Since #12206 the shared build does not run on the requester's context, so it keeps going after the waiter gives up and later lookups find the directory cached. A timed-out wait records a rebuild attempt, so lookups during the cooldown do not queue on a build that is already known to be slow. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: wait for the rebuild's listing in TestLookupDoesNotWaitOutSlowRebuild The build runs on its own goroutine, so the lookup that stopped waiting for it can return before the build's ListEntries reaches the filer. The test read `started` without waiting right after the lookup returned, which relied on an ordering nothing guarantees, and the ListEntries count taken afterwards assumed the same. Wait for the listing to arrive, bounded by the test's deadline. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: keep children inserted while a rebuild wipe runs A deferred create inserts its placeholder before Create registers the handle that pins it. The single-lock wipe made such an insert wait until it finished, so the placeholder survived; a batch that runs in that gap judged it unpinned and dropped it, and the rebuilt listing then omitted the file until its flush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drop a cached path that an event vacates during a rebuild wipe A build replays only the events later than its listing's snapshot and leaves the earlier ones to the listing, which starts after the wipe. With the wipe in batches a file's whole life fits inside it: created, flushed, then unlinked or renamed away. Both events are earlier than the snapshot and are skipped, the listing has no such file, and the placeholder the wipe kept stays in the published directory until the next rebuild. While a directory's wipe runs, an event buffered for it now takes the path it vacates out of the store at once, fenced by versions like any other event. After the wipe the store holds what the listing put there, and a removal earlier than the snapshot may still arrive, so from then on the event is left to the replay as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: check which file a removal took away during a rebuild wipe Two things the removal applied during a rebuild wipe got wrong. A placeholder is unversioned, so the version gate lets every removal through. One that arrived late, for an earlier file of the same name, took out the placeholder of a file created since. The entry the event took away is now compared with the cached one, by inode or, with no inode to compare, by creation time. An event that only names the file cannot tell and is taken at its word. The entry was deleted without OP=MV, so taking one name of a hard-linked file out of the cache also took one off the count its other names share. A replayed event that vacates a path already deletes with OP=MV. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: keep a removal the rebuild wipe declined out of the replay The wipe declines a removal when what is cached there is newer than the event or is another file than the one it took away. The event stayed buffered anyway. An unversioned listing clears the children's version records and replays every buffered event, so the declined removal then deleted the entry the wipe kept and the directory was published without it. A declined removal now buffers only the name it puts in place, so a rename still lands on replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: check a declined removal again when the build replays it The previous commit dropped the removal half of an event the wipe declined, judged by the file cached when the event arrived. Earlier buffered events can replace that file during the replay: a listing attempt that failed leaves its events buffered, so the retry's wipe may see the first attempt's file while the replay puts a later one in place first. The dropped delete then left that later file published. The wipe now records which removals it declined, and the replay checks each against the entry it finds at that point, replaying only the name the event puts in place when that entry is still another file. A removal declined by version is replayed as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep a declined removal's invalidation off the placeholder's handle After the replay the build invalidates every buffered event again, raised to the snapshot, and it still sent the original of a removal the replay rejected. A late delete of an earlier file then reached the handle of the placeholder at that name: the placeholder is unversioned, so the raised timestamp got past it and the handle was marked deleted. The replay's decision on a declined removal now replaces the event in the buffer, and the invalidations use what was replayed. It is made before the snapshot check, so a removal the listing covered is judged the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: keep an event's signatures on the halves a rename is split into A declined removal replays as its rename's create half, and a rename across a building directory is split in two. Both dropped the event's filer signatures, so a handle stamped by that filer no longer fenced the replayed invalidation by timestamp and could take older listed contents over newer ones it had read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mount: drain invalidations around the declined-removal build check Invalidations run on a background worker, so the baseline could miss the removal's own and the final read could run before the build's arrived. 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> |
||
|
|
3159b8408c |
filer, volume: fsync chunk deletes under an fsync path rule (#12759)
* volume: fsync a batch delete that asks for it BatchDeleteRequest gets an fsync field, and the Go and Rust volume servers pass it to the needle delete, which already orders the tombstone, .dat sync, publish and .idx sync for a durable delete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * operation: pass an fsync flag to batch deletes DeleteFileIdsWithLookupVolumeId and DeleteFileIdsAtOneVolumeServer take an fsync argument and send it in the BatchDeleteRequest. Every caller passes false for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: fsync chunk deletes under an fsync path rule DeleteChunks passes the path rule's fsync flag to the deletion queue. The flag is kept with the pending record until the delete is confirmed, so retries and re-queues keep it, and the batch and retry loops send marked ids in a durable BatchDelete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep fsync marks in the deletion ledger Marked ids go into the trailing parts of a manifest ledger, counted by fsyncParts. Older filers read those parts as plain ids and still delete them; a reload or a claimed foreign ledger restores the marks. A ledger without marks keeps the single array form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: record a queued deletion before the delete loop can see it queueDeletions published the ids to the hot queue before taking the ledger lock, so a concurrent flush could delete an id before its fsync mark landed and then forget the mark with the record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: fsync a folder delete's chunks by each child's path rule A recursive delete collected its file children's chunks and resolved the rule once for the folder, which misses a trailing-slash rule on the folder itself and file-prefix rules. Each file child's own rule now decides fsync; the folder rule still decides chunk deletion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a newer fsync request when a plain delete finishes An id re-queued with fsync while a plain delete of it was in flight lost its mark when that delete succeeded, so the queued copy also ran without fsync. A plain attempt now leaves a marked record for its queued copy; a durable delete of an already-deleted needle still syncs the tombstone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: delete a folder's plain child chunks without fsync Children whose own rule turns fsync off were still deleted durably when the folder's rule asked for fsync. Only the children marked by their own rule now go out with fsync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: retry a durable chunk delete the volume server failed A volume server rolls back a durable delete it cannot sync and answers with a 5xx carrying the I/O error text, which the classifier took as permanent, so the record and its fsync mark were dropped while the needle stayed live. A 5xx answer to a durable delete is now retryable, within the usual attempt limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f88751c3ff |
s3api: evaluate request condition keys for STS sessions (#12762)
* s3api: build request condition keys in one helper Split the keys ExtractConditionValuesFromRequest reads from the request itself into RequestConditionValues, keeping aws:SourceIp and the bucket-listing keys in the method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: evaluate request condition keys for STS sessions The IAM integration context for STS and OIDC sessions carried only the source IP, legacy user agent/referer keys and claims, so role and session policy conditions on s3:x-amz-*, aws:SecureTransport, aws:CurrentTime, s3:RequestObjectTag/* and the other request keys never matched: a Deny on them never fired, and a negated Deny always did. Add the same request keys the static identity path evaluates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3api: report SigV4 presigned requests as REST-QUERY-STRING s3:authType recognized only SigV2 query authentication, so a policy condition on REST-QUERY-STRING never matched a SigV4 presigned URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |