Repository navigation
Conversation
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? |
Backport the complete FileService range fan-out fix to `4.2-dev`. `4.2-dev` contains the range-bypass and 200 ms fallback introduced by #24759 and #24871, but does not contain #26758. Therefore backporting only the single-entry follow-up from #26834 would leave the multi-entry sparse-range fan-out unchanged. This PR applies both fixes in dependency order: 1. #26758: avoid wide sparse fallback reads and bind waiters to the exact cache-producing merge generation. 2. #26834: coalesce duplicate single-entry exact-range fallbacks after the full-object generation exceeds its short wait. The normal cache-hit and uncontended read paths are unchanged. All waits remain caller-cancelable and bounded. Merge generations have no background goroutine or persistent queue and are deleted on leader completion. Followers recheck cache publication before falling back to a bounded exact read. Validation on the `4.2-dev` base (`4066fffaf7`): - focused FileService regression set, `-count=3` - six concurrency/lifecycle tests under `-race` (`20` or `100` repetitions) - full `pkg/fileservice` test - full `pkg/fileservice` race test - `go build` and `go vet` for `pkg/fileservice` Backported commits retain `-x` provenance for #26758 and #26834. Approved by: @XuPeng-SH
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed. No blocking correctness, concurrency, lifecycle, or performance findings. Verified cache publication precedes generation completion; bounded exact-range fallback respects cancellation and does not rejoin a timed-out generation. Local pkg/fileservice build, vet, focused tests, full package tests, and race checks passed.
Merge Queue Status
This pull request spent 8 minutes 26 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26834 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.
Failing checks:
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
|
…igin#26834) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26172 Follow-up to matrixorigin#26758. ## What this PR does / why we need it: ### Root cause matrixorigin#26758 prevents a stalled full-object cache fill from turning sparse multi-entry reads into large amplified S3 ranges. It intentionally preserves the 200ms fallback for a single bounded entry. That remaining path bypasses the I/O merger. When many requests need the same entry while the full-object fill is still running, every follower starts the same exact S3 range GET after 200ms. A small hot range can therefore fan out across the object-storage connection pool and increase network, heap, and query latency pressure. ### Fix - After the existing 200ms full-object wait expires, create a second merger generation keyed by the exact single-entry range. - Admit this merge only when the leader can publish a reusable memory-cache or per-entry disk-cache result. - Bind followers to the exact generation and wait at most the existing one-minute I/O limit, also respecting the caller context. - Recheck caches after leader completion. If publication fails or the wait expires, continue with the existing exact-range fallback without rejoining either merge generation. - Keep leader completion ordered after deferred cache updates, so followers cannot wake before the reusable result is published. ### Safety boundaries - Cache hits, uncontended reads, multi-entry reads, stream reads, and no-cache-write reads are unchanged. - Different ranges use different merge keys and proceed independently. - No goroutine, queue, retry loop, wire format, disk format, or configuration is added. - Cancellation and the existing local I/O wait limit remain terminal bounds. - Cache admission failure remains a normal cache miss and falls back to one exact range read. ### Tests - A deterministic blocked-storage test starts 16 same-range followers and proves they do not issue duplicate object-storage reads, honor caller cancellation, and reuse the leader's published cache result. - A second deterministic test proves different exact ranges do not block each other. - Focused tests passed with `-race -count=20`. - Full `pkg/fileservice` tests and full package race tests passed. - `go build`, `go vet`, and `git diff --check` passed. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…igin#26834) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26172 Follow-up to matrixorigin#26758. ## What this PR does / why we need it: ### Root cause matrixorigin#26758 prevents a stalled full-object cache fill from turning sparse multi-entry reads into large amplified S3 ranges. It intentionally preserves the 200ms fallback for a single bounded entry. That remaining path bypasses the I/O merger. When many requests need the same entry while the full-object fill is still running, every follower starts the same exact S3 range GET after 200ms. A small hot range can therefore fan out across the object-storage connection pool and increase network, heap, and query latency pressure. ### Fix - After the existing 200ms full-object wait expires, create a second merger generation keyed by the exact single-entry range. - Admit this merge only when the leader can publish a reusable memory-cache or per-entry disk-cache result. - Bind followers to the exact generation and wait at most the existing one-minute I/O limit, also respecting the caller context. - Recheck caches after leader completion. If publication fails or the wait expires, continue with the existing exact-range fallback without rejoining either merge generation. - Keep leader completion ordered after deferred cache updates, so followers cannot wake before the reusable result is published. ### Safety boundaries - Cache hits, uncontended reads, multi-entry reads, stream reads, and no-cache-write reads are unchanged. - Different ranges use different merge keys and proceed independently. - No goroutine, queue, retry loop, wire format, disk format, or configuration is added. - Cancellation and the existing local I/O wait limit remain terminal bounds. - Cache admission failure remains a normal cache miss and falls back to one exact range read. ### Tests - A deterministic blocked-storage test starts 16 same-range followers and proves they do not issue duplicate object-storage reads, honor caller cancellation, and reuse the leader's published cache result. - A second deterministic test proves different exact ranges do not block each other. - Focused tests passed with `-race -count=20`. - Full `pkg/fileservice` tests and full package race tests passed. - `go build`, `go vet`, and `git diff --check` passed. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…igin#26834) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26172 Follow-up to matrixorigin#26758. ## What this PR does / why we need it: ### Root cause matrixorigin#26758 prevents a stalled full-object cache fill from turning sparse multi-entry reads into large amplified S3 ranges. It intentionally preserves the 200ms fallback for a single bounded entry. That remaining path bypasses the I/O merger. When many requests need the same entry while the full-object fill is still running, every follower starts the same exact S3 range GET after 200ms. A small hot range can therefore fan out across the object-storage connection pool and increase network, heap, and query latency pressure. ### Fix - After the existing 200ms full-object wait expires, create a second merger generation keyed by the exact single-entry range. - Admit this merge only when the leader can publish a reusable memory-cache or per-entry disk-cache result. - Bind followers to the exact generation and wait at most the existing one-minute I/O limit, also respecting the caller context. - Recheck caches after leader completion. If publication fails or the wait expires, continue with the existing exact-range fallback without rejoining either merge generation. - Keep leader completion ordered after deferred cache updates, so followers cannot wake before the reusable result is published. ### Safety boundaries - Cache hits, uncontended reads, multi-entry reads, stream reads, and no-cache-write reads are unchanged. - Different ranges use different merge keys and proceed independently. - No goroutine, queue, retry loop, wire format, disk format, or configuration is added. - Cancellation and the existing local I/O wait limit remain terminal bounds. - Cache admission failure remains a normal cache miss and falls back to one exact range read. ### Tests - A deterministic blocked-storage test starts 16 same-range followers and proves they do not issue duplicate object-storage reads, honor caller cancellation, and reuse the leader's published cache result. - A second deterministic test proves different exact ranges do not block each other. - Focused tests passed with `-race -count=20`. - Full `pkg/fileservice` tests and full package race tests passed. - `go build`, `go vet`, and `git diff --check` passed. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #26172
Follow-up to #26758.
What this PR does / why we need it:
Root cause
#26758 prevents a stalled full-object cache fill from turning sparse multi-entry reads into large amplified S3 ranges. It intentionally preserves the 200ms fallback for a single bounded entry.
That remaining path bypasses the I/O merger. When many requests need the same entry while the full-object fill is still running, every follower starts the same exact S3 range GET after 200ms. A small hot range can therefore fan out across the object-storage connection pool and increase network, heap, and query latency pressure.
Fix
Safety boundaries
Tests
-race -count=20.pkg/fileservicetests and full package race tests passed.go build,go vet, andgit diff --checkpassed.