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

[pulsar-client-api] Fix Unavailable Hash Range Condition #9041

Merged
merged 2 commits into from
Dec 24, 2020
Merged

[pulsar-client-api] Fix Unavailable Hash Range Condition #9041

merged 2 commits into from
Dec 24, 2020

Conversation

k2la
Copy link
Contributor

@k2la k2la commented Dec 23, 2020

Motivation

if (range1.getStart() < 0 || range1.getEnd() > DEFAULT_HASH_RANGE_SIZE) {
throw new IllegalArgumentException("Ranges must be [0, 65535] but provided range is " + range1);
}

When range is [0, 65536], the above condition is false.

Modification

Change from range1.getEnd() > DEFAULT_HASH_RANGE_SIZE to range1.getEnd() >= DEFAULT_HASH_RANGE_SIZE.

@k2la k2la changed the title Fix Unavailable Hash Range Condition [pulsar-broker] Fix Unavailable Hash Range Condition Dec 23, 2020
@k2la k2la changed the title [pulsar-broker] Fix Unavailable Hash Range Condition [pulsar-client-api] Fix Unavailable Hash Range Condition Dec 23, 2020
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@sijie
Copy link
Member

sijie commented Dec 23, 2020

/pulsarbot run-failure-checks

2 similar comments
@k2la
Copy link
Contributor Author

k2la commented Dec 24, 2020

/pulsarbot run-failure-checks

@k2la
Copy link
Contributor Author

k2la commented Dec 24, 2020

/pulsarbot run-failure-checks

@sijie sijie merged commit 48779bd into apache:master Dec 24, 2020
@k2la k2la deleted the fix_unavailable_hash_range_condition branch January 4, 2021 23:14
codelipenghui pushed a commit to codelipenghui/incubator-pulsar that referenced this pull request Jan 6, 2021
### Motivation
https://github.com/apache/pulsar/blob/3b2c8526a96fc90e948dbeb510e8400a628c749a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/KeySharedPolicy.java#L110-L112

When range is [0, 65536], the above condition is false.

### Modification
Change from `range1.getEnd() > DEFAULT_HASH_RANGE_SIZE` to `range1.getEnd() >= DEFAULT_HASH_RANGE_SIZE`.

(cherry picked from commit 48779bd)
codelipenghui pushed a commit that referenced this pull request Jan 7, 2021
### Motivation
https://github.com/apache/pulsar/blob/3b2c8526a96fc90e948dbeb510e8400a628c749a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/KeySharedPolicy.java#L110-L112

When range is [0, 65536], the above condition is false.

### Modification
Change from `range1.getEnd() > DEFAULT_HASH_RANGE_SIZE` to `range1.getEnd() >= DEFAULT_HASH_RANGE_SIZE`.

(cherry picked from commit 48779bd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants