Repository navigation
Conversation
aptend
left a comment
There was a problem hiding this comment.
Deep re-review completed on exact head 09f82a241581e21e5b2832408f24d3b4fa455862. I read the complete review/thread history, audited the increment since my changes-requested head 048d78f1c6549dfa0bcefdcc5d4983ae3698ce8f, and rechecked the full PR diff. My open-reader eviction blocker is closed: opening a cache file now acquires a path read generation; mutation/eviction invalidates that generation before FIFO membership becomes externally invisible; and reindexing must atomically claim the still-current generation. This closes both Delete and capacity-eviction orderings without waiting for readers holding safe open descriptors. I also audited the new FIFO prepare/finish-eviction lifecycle, including update-owner transfer, callback panic cleanup, replacement behavior, and lock ordering. The checked-in deterministic Delete/ForceEvict regression passes. Full fileservice/fifocache/metric suites pass, and the focused reader-generation plus prepare-evict tests pass under -race -count=20 with the required CGo setup. No blocking findings remain.
| defer d.releaseAsyncUpdateResources(job) | ||
| <-previous | ||
| for _, fn := range job.callbacks { | ||
| fn(job.filePath, job.entry) |
There was a problem hiding this comment.
[P1] Contain panics at the library-owned async callback boundary
Async updates now invoke OnDiskCacheWritten callbacks from the goroutine created here. If a callback panics, the caller can no longer recover around DiskCache.Update; an unrecovered panic in this goroutine terminates the entire Go process/CN. The existing close(done) and resource-release defers run during unwinding, but they do not contain the panic.
I verified this as a PR regression on the exact revisions with one deterministic counterexample: wrap cache.Update(..., true) in a goroutine with defer recover(), register an OnDiskCacheWritten callback that signals entry and panics, then wait for the recovery result. On base f331bb966e3e5ec5d0acf6e187b5366b0487294e the test passes because the callback runs on the invoking stack; on head 09f82a241581e21e5b2832408f24d3b4fa455862 the test process exits at this line with panic: callback panic.
Please supervise callback invocation at the library-owned goroutine boundary (with observable logging/metrics), define whether later callbacks continue after one callback fails, and add a regression proving that the process plus the ordered callback/resource-release chain survive a callback panic.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review completed on exact head ca9c9b3382d30145aa71ad74d7e9490bee5373bd, independent of the still-running CI.
The previous async-callback panic blocker is closed. Each async callback now has an independent recovery boundary; a hostile panic value is not stringified; later callbacks on the same update and callbacks on subsequent updates continue; and the existing resource defer still releases the slot, pending-byte accounting, and callback-retained data exactly once. Panic observability uses an unlabeled counter and a fixed, globally budgeted event, so it does not introduce metric cardinality or unbounded log-key growth.
I also re-audited the complete PR through the ownership, state-transition, wait-for, restart/Close, and bounded-growth models: range-update admission and copied-data accounting; full-file temp/fd/path publication and cleanup; FIFO prepare/finish eviction; path read generations and stale-reader reindex exclusion; Close sealing/drain behavior; S3 buffered, streaming, prefetch, and IOMerger integrations; cancellation; callback ordering; and failure/panic paths. The intentionally deferred stale-range invalidation and physical temporary/inflight-byte quota remain explicitly tracked by #27367 and #25764.
Validation on this exact head: git diff --check; build and vet for all changed Go packages; full normal and full -race suites for pkg/fileservice, pkg/fileservice/fifocache, and pkg/util/metric/v2; plus each of the four lifecycle/IOMerger focus tests independently under -race -count=100 using the repository CGo test wrapper. All passed. No blocking findings remain on this head.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27358
Fixes #27359
Fixes #27360
Fixes #27363
Fixes #27366
What this PR does / why we need it:
Disk-cache operations had several coupled lifecycle problems under multi-CN load and slow or failing local storage:
This change closes those paths around one ownership model:
Synchronous behavior remains available through SetAsyncUpdate(false).
Validation
Local, after the final semantic edit:
On the isolated 2-CN + MinIO harness at 10.222.1.55:
Known follow-ups