Repository navigation
Conversation
Make allocation-reservation handoff atomic with FIFO charging, while preserving the unlocked path for values without reservations. Continue synchronous reclamation after deleted main-queue records and cover ownership, panic cleanup, and pending enqueue boundaries. Fixes matrixorigin#29088
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Code review of ce6176b against base/merge-base 480b917: no blocking findings identified. This is a focused correction of the two independently reproduced #29088 defects, not a FIFO-policy redesign. Reviewed all 11 changed files and traced reservation creation/commit/release, MemCache.Update, DataCache adapters, Bytes and validatedVectorCacheData forwarding, normal/pending/pressure enqueue, duplicate/rejected admission, callback panic cleanup, and synchronous eviction consumers.
Validation independently run on this exact head with GOMAXPROCS=2, GOMEMLIMIT=1GiB and -p 1: full fifocache package -race -count=1 passed; each of TestDataCacheSetWithoutReservationDoesNotTakeAccountingGuard, TestPressureAccountingCommitPanicCleansPendingEviction, TestAccountingReservationIsHeldThroughPreEnqueuePostSet and TestAccountingCommitChargesPendingEnqueueBeforeSetReturn separately passed -race -count=100. Diff check passed; review worktree is clean. Wider fileservice/ObjectIO tests, original reproductions and benchmarks are documented by the author in the PR; I did not rerun those Linux/native validations or an IVF workload. CI was still running when inspected, so this is not a claim that all CI has passed or that a particular IVF speedup is guaranteed. Code-level approval recommendation. The authenticated account is also the PR author (LeftHandCold), so GitHub disallows a formal self-APPROVE; recording the review here instead. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review (Astra medium, exact head ce6176b)
APPROVE.
Reviewed all changed hunks across 11 files against base 480b917.
Ownership: reservation commit/release remains one-shot; duplicate/rejected insertion preserves cleanup ownership; pressure admission records ownership before fallible callbacks.
Locking/liveness: accounting handoff shares the allocation-admission guard. Production commit uses CAS/atomic decrement; post callbacks execute outside that guard.
Accounting/reclamation: direct and pending enqueue precede reservation commit. Both synchronous eviction loops recognize progress in either queue, including deleted records and promotion. Consumers and deterministic accounting/reclamation tests were traced.
This focused bug fix is exempt from the large-feature design gate. No SQL, protocol, persisted-format, or platform contract changes require additional artifacts.
Exact-head CI workflow success was verified, including required CI. Raw CI log retrieval failed due network errors; no local Linux/native validation was rerun. No required fixes identified.
Merge Queue Status
This pull request spent 1 minute 5 seconds in the queue, with no time running CI. Waiting for any of
All conditions
ReasonPull request #29092 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29088
What this PR does / why we need it:
This fixes two independently reproduced accounting/reclamation defects in FileService MemCache:
used2, but the progress check only recognizedused1changes or a newly released value, leaving reclaimable live entries above the requested target.The reservation handoff now uses the same accounting guard as allocation admission. FIFO used/pending bytes are charged before committing the reservation, with no intermediate state visible to another admission. Reservation release uses an atomic decrement rather than reacquiring the guard. Values without the reservation protocol do not acquire this guard.
External Set/eviction callbacks remain outside the guard. The pressure-admission path publishes the insertion ownership before commit/eviction callbacks can panic, so deferred cleanup cannot release an already-admitted value as a rejected insertion. Both synchronous-eviction loops now recognize changes to either queue counter, including promotion that changes their distribution without changing their sum.
The scope excludes FIFO replacement-policy changes, larger cache budgets, S3/DiskCache read-policy changes, and SQL or persisted-format changes. Cache-hit reads do not acquire the accounting guard. The regression tests target the internal cache contract, so no new SQL BVT or production fault hook is added.
Validation
Validated on an isolated Linux/amd64 source checkout on server 50, using Go 1.26.4. SHA-256 checks match all 11 changed source/test files to the submitted worktree. No running cluster was replaced.
pkg/fileserviceandpkg/fileservice/fifocachetests, both normally and with-race: pass.-race -count=100: pass. ObjectIO coverage includes validated-vector wrappers and memory/remote cache admission.go vet -mod=readonly ./pkg/fileservice/fifocache ./pkg/fileservice ./pkg/objectio: pass, using the repository CGo header/library setup. ObjectIO was executed withmo-cgo-test.gofmtandgit diff --check: pass.Same-host, same-command microbenchmarks (
-benchmem -count=5, medians in ns/op):Allocs/op are unchanged. An earlier local prototype unnecessarily locked non-reservation values and regressed parallel Set; that prototype is not included. The final UT explicitly requires a non-reservation Set to finish even while the accounting guard is held. These are package/microbenchmark checks, not an end-to-end IVF throughput guarantee.
Evidence boundary
The issue reproductions prove implementation defects, not the fraction of an IVF Daily slowdown caused by them. This PR must not be presented as a guarantee of a specific IVF QPS or as a complete production-image performance A/B.