hard-invalidate region on RegionNotFound instead of async reload#1916
hard-invalidate region on RegionNotFound instead of async reload#1916mittalrishabh wants to merge 2 commits intotikv:masterfrom
Conversation
…nc reload Replace AsyncInvalidateCachedRegion with InvalidateCachedRegion in the onRegionNotFound path so that concurrent requests immediately stop using the stale region. The current request's selector is allowed one more leader retry via the new regionInvalidatedForRetry flag, which bypasses the validity check in next(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: rishabh mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh mittal <mittalrishabh@gmail.com>
📝 WalkthroughWalkthroughThis PR removes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: you06, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
issue #1892
The original fix does not work because in-flight requests continue to fail with region-not-found errors. This change hard-invalidates the region so that concurrent requests stop using the stale cache, and introduces a regionInvalidatedForRetry flag to allow the current request to retry on the leader before giving up.
Unit test
Deployed in prod to verify that it fixed
region-not-founderrorsSummary by CodeRabbit