fix: fail closed instead of silently dropping keys whose region cannot be resolved (#244) - #544
Merged
Merged
Conversation
s2x
force-pushed
the
fix/244-fail-unresolved-region-keys-ci
branch
2 times, most recently
from
September 9, 2026 18:54
f169cd1 to
8ce9a38
Compare
…on contract (#244) Since #244 batch keys that cannot be resolved to a region throw instead of being silently dropped. Update the Grpc-suite tests that relied on the old silent-drop path: stub scanRegions where resolution is required and expect BatchPartialFailureException at the (unreachable) transport layer, and expect TiKvException when ingest() is called with an unresolvable key.
…ore batchGet behavior tests)
s2x
marked this pull request as ready for review
September 9, 2026 20:44
s2x
force-pushed
the
fix/244-fail-unresolved-region-keys-ci
branch
from
September 9, 2026 20:49
698fd71 to
0e7d9f6
Compare
…mposition (Grpc suite)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #244
Changes
RegionResolver::batchResolveRegions()throws aTiKvExceptionnaming the first key PD could not resolve to a region, instead of silently omitting it (previouslybatchPut()reported success without writing the key andbatchGet()returnednullas if the key did not exist)scanRegions($minKey, $maxKey)is half-open, so a batch's maximum key sitting on a region boundary always failed resolution — the scan now uses$maxKey . "\x00"as its upper bound, mirroring client-go's inclusive resolution of the last keyRegionGrouper::groupKeysByRegionBatch(),groupItemsByRegion()andTxnReader::batchGetFromTiKV()throw on an unresolvable key instead ofcontinue-ing; the "silently skipped" contract is removed from the docsTransactionTesttests that silently passed while every key was dropped before any RPC) and add new coverageChangelog
TiKvException, and thescanRegionsupper-bound off-by-one is fixed ([REG-13] Fail instead of silently dropping keys whose region cannot be resolved #244)Code Review