Skip to content
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

BatchScanRegions need to return an error to tell client regions exist hole for retry #8358

Closed
okJiang opened this issue Jul 3, 2024 · 7 comments · Fixed by #8375
Closed
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@Tristan1900
Copy link

@okJiang Looks like after the proto change, TiKV code pd_client/src/util#check_resp_header breaks because of not handling the added error type. Curious if there is a fix already opened or in progress? Or who should be good to contact to fix it? Thanks!

@okJiang
Copy link
Member Author

okJiang commented Aug 26, 2024

@okJiang Looks like after the proto change, TiKV code pd_client/src/util#check_resp_header breaks because of not handling the added error type. Curious if there is a fix already opened or in progress? Or who should be good to contact to fix it? Thanks!

If you don't set the added parameter(contain_all_key_range), it will not return the added error type(REGIONS_NOT_CONTAIN_ALL_KEY_RANGE). So can you explain which problem do you meet?

@Tristan1900
Copy link

Tristan1900 commented Aug 26, 2024

@okJiang hmm, from my side it's a compiler error that check_resp_header did not exhaustively handle all the enum type. BTW I did not make any changes on pd_client, I'm working on the backup side

image

maybe I somehow use it wrong? I added a panic to bypass the complier to not blocking me but I don't think that's the correct way to do so asking for help.

@okJiang
Copy link
Member Author

okJiang commented Aug 27, 2024

@okJiang hmm, from my side it's a compiler error that check_resp_header did not exhaustively handle all the enum type. BTW I did not make any changes on pd_client, I'm working on the backup side

image maybe I somehow use it wrong? I added a panic to bypass the complier to not blocking me but I don't think that's the correct way to do so asking for help.

I am sorry that I am not familiar with rust... @YuJuncen Can you help to reply it?😂

@YuJuncen
Copy link

YuJuncen commented Aug 27, 2024

@Tristan1900 You may just append _ => unreachable!() or _ => unimplemented!() to the match block. TBH I guess we'd better add a #[non_exhaustive] to the protocol buffer enums...

@Tristan1900
Copy link

Tristan1900 commented Aug 27, 2024

@YuJuncen ok, I'm not sure how should we behave on TiKV side in response of this error so didn't add anything on my own. Sounds like this error will never happen on TiKV side? If we are sure about that I can add unreachable thing.
I feel like having complier error is better in case people forgot to add the handling after changing the proto, but yeah it's cubersome.

@3AceShowHand
Copy link

I also meet this issue, any update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants