-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix direct retry handling for partition key range gone #49613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arnabnandy7
wants to merge
12
commits into
Azure:main
Choose a base branch
from
arnabnandy7:fix/cosmos-410-1002-pkrg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6cc81af
Fix direct retry handling for partition key range gone
arnabnandy7 e2ec601
Potential fix for pull request finding
arnabnandy7 ad65758
Changelog entries in this file consistently end with a period; this n…
arnabnandy7 5c965ce
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 7bad7f2
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 3a5f527
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 2e2fe7b
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 1fe615c
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 b0c0228
fix: Test failures
arnabnandy7 012dede
Address PKRangeGone retry review comments
arnabnandy7 7ee385c
Fix PKRangeGone retry scope for address resolution
arnabnandy7 ceae70b
Merge branch 'main' into fix/cosmos-410-1002-pkrg
arnabnandy7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would need adjoining FaultInjection tests as well to simulate e2e behavior - PKRangeGone as far as I recall is only happening for address lookups against Gateway - and is handled there. So, I don't think adding it to GoneAndRetryWithRetryPolicy is needed / helps.
@xinlian12 - can you double-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @FabianMeiswinkel that makes sense. The intent here was to cover the case where direct-mode address resolution surfaces 410/1002 as
PartitionKeyRangeGoneExceptionbefore the request can be re-routed, so this policy clears the resolved PKRange and forces a PKRange refresh similar to split handling.I agree the PR should prove that path with FaultInjection instead of only unit tests. I see
FaultInjectionServerErrorType.PARTITION_IS_GONEmaps to 410/1002, so I can add direct-mode FI coverage around that. If this exception is guaranteed to be handled before reachingGoneAndRetryWithRetryPolicy, then I’m happy to close/rework this PR instead. @xinlian12 could you confirm the expected layer?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FabianMeiswinkel I tightened this so
PartitionKeyRangeGoneExceptionis not retried broadly anymore.The retry path is now opt-in only for address-resolution-created exceptions:
AddressResolvermarks the exception before throwing itGatewayAddressCachedoes the same for the address-feed no-entry pathPartitionKeyRangeGoneExceptionremains non-retryable, preserving the change feed / query behaviorI also added/updated unit coverage in
GoneAndRetryWithRetryPolicyTestfor marked vs unmarkedPartitionKeyRangeGoneException.I have not added a full FI/e2e test yet. Do you still want FI coverage for this path, or is the scoped marker approach enough?