-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] ClassCastException when specify flow_or_qps_equally_div… #17872
base: master
Are you sure you want to change the base?
Conversation
…ide and default is not
@zhangqian321 Please add the following content to your PR description and select a checkbox:
|
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.
LGTM +1
@@ -832,8 +833,7 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle, | |||
NamespaceBundleSplitAlgorithm splitAlgorithm, | |||
List<Long> boundaries) { | |||
BundleSplitOption bundleSplitOption; | |||
if (config.getDefaultNamespaceBundleSplitAlgorithm() | |||
.equals(NamespaceBundleSplitAlgorithm.FLOW_OR_QPS_EQUALLY_DIVIDE)) { | |||
if (splitAlgorithm instanceof FlowOrQpsEquallyDivideBundleSplitAlgorithm) { |
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.
Good catch. Left a minor suggestion. Please add a test to avoid regression.
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.
LGTM
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.
LGTM
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.
LGTM
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.
@zhangqian321 Nice catch!
Could you please add an unit test?
Codecov Report
@@ Coverage Diff @@
## master #17872 +/- ##
=========================================
Coverage ? 45.70%
Complexity ? 17526
=========================================
Files ? 1573
Lines ? 128208
Branches ? 14097
=========================================
Hits ? 58597
Misses ? 63557
Partials ? 6054
Flags with carried forward coverage won't be shown. Click here to find out more. |
how can we miss such ClassCastException in the Pulsar code? didn't we add any unit-test case for the PR which caused this failure? certainly, not good practice in code have such RuntImeException. |
The pr had no activity for 30 days, mark with Stale label. |
splitAlgorithm is alreay specified by user or default before input to this method. It will initial wrong option type and throw ClassCastException when user specified FlowOrQpsEquallyDivideBundleSplitAlgorithm and default is not.