-
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] Fix compatibility issues for PIP-344 #23136
[fix] [broker] Fix compatibility issues for PIP-344 #23136
Conversation
/pulsarbot rerun-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23136 +/- ##
============================================
+ Coverage 73.57% 74.52% +0.94%
- Complexity 32624 33566 +942
============================================
Files 1877 1919 +42
Lines 139502 144174 +4672
Branches 15299 15761 +462
============================================
+ Hits 102638 107442 +4804
+ Misses 28908 28499 -409
- Partials 7956 8233 +277
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Although I agree with this direction, have we discussed with the community about this backward compatibility resolutions?
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
Outdated
Show resolved
Hide resolved
Can pulsar detect and fix this inconsistency automatically? |
After the producers/consumers that are connected to the non-partitioned are offline, every thing will be fine. |
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
Outdated
Show resolved
Hide resolved
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.
The old behavior is not good and it looks like this change does not only resolve the compatibility issue. Instead, it is going to find a more "better" solution.
IMO, we can split it into two tasks.
- Purely fix the compatibility issue. The logic should be simple and easy to understand, we only use the new API If the new API is supported by the broker.
- Find a potential solution to continue to improve it.
So that we can make sure the both PIP-334 and this change will not break anything.
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
Outdated
Show resolved
Hide resolved
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
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/LookupService.java
Show resolved
Hide resolved
Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 702c0b3)
Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 702c0b3)
Co-authored-by: Lari Hotari <lhotari@apache.org>
Motivation & Modifications
After PIP-344 add a public API pulsarClient.getPartitionsForTopic(String topic, boolean metadataAutoCreationEnabled), there are
3
compatibility issues:1. Using DLQ( brokers’ version is
<3.0.6
, and clients’ version is>=3.0.6
)PIP-344 fixed a bug that the Retry/DLQ consumer will still trigger a Retry/DLQ topic with the old rule
{namespace}/{subscription}-RETRY/DLQ
, but the rule was changed to{namespace}/{topic}-{subscription}-RETRY/DLQ
after2.8.0
. This behavior has been defined in the PIP-344, so it is fine.Modifications for compatibility: modify the error message to let users know what happened.
2. Using Geo-Replication, the version of the local cluster and the remote cluster is not the same ( local clusters are
>=3.0.6
, and remote clusters are<3.0.6
)3.0.6
and "3.3.1" and another is smaller than3.0.6
and3.3.1
.3.0.6
and3.3.1
, before that the API "getPartitionedTopicMetadata" will trigger a creation for partitioned topic metadata automatically even if you just want to query it. So the brokers whose version is less than3.0.6
and3.3.1
do not support the new API.3. Using non-persistent topics, the versions of the brokers in the same cluster are different( some are less than
3.0.6
)getPartitionedTopicMetadata(topic, false)
was supported at3.0.6
and3.3.1
, before that the APIgetPartitionedTopicMetadata(topic)
will trigger a creation for partitioned topic metadata automatically even if you just want query it. So the brokers whose version is less than3.0.6
and3.3.1
do not support the new API.2
brokers in a cluster, and the version is less than3.0.1
, rolling upgrade brokers to3.0.6
. After the first broker restarted, there was one broker with version3.0.6
and another is3.0.1
, and when the internal client tries to callgetPartitionedTopicMetadata(topic, false)
to the broker with a lower version, it will get this error.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x