You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2025/10/04 06:22:44 UTC
[PR] [fix][client] Make auto partitions update work for old brokers without PIP-344 [pulsar]
BewareMyPower opened a new pull request, #24822:
URL: https://github.com/apache/pulsar/pull/24822
### Motivation
See https://lists.apache.org/thread/tpd2kgl4v3x8bkw0skv0nj38rzrk56t7
### Modifications
Set the 3rd argument of `getPartitionedTopicMetadata` to `true` in `PulsarClientImpl#getPartitionsForTopic`, which is used to query the number of partitions.
Add `testAutoPartitionsUpdate` to cover the case. Specially, it tests a consumer that subscribes two partitioned topics to cover the path here: https://github.com/apache/pulsar/blob/008e4ebbaf5808c0f859dddabd8382991f32d3aa/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L182
P.S. This test is only added to `ClientTest25`, which runs tests against `apachepulsar/pulsar:2.5.0` image. The current backward compatibility test strategy is ambiguous that only 2.2.0, 2.3.0, 2.4.0, 2.5.0 are tested. It's hard to cover all old versions, but only choose these 4 versions does not make sense. This topic should be out of the scope of this PR. Anyway, the test on 2.5.0 can already prevent regression on the fix.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] Make auto partitions update work for old brokers without PIP-344 [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #24822:
URL: https://github.com/apache/pulsar/pull/24822#issuecomment-3380148572
I think it has been explained in https://github.com/apache/pulsar/pull/23136. I updated the test and the PIP document now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] Make auto partitions update work for old brokers without PIP-344 [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #24822:
URL: https://github.com/apache/pulsar/pull/24822#issuecomment-3377538011
There seems to be a test that explicitly tests for the behavior that connecting to an older broker fails:
```
Error: Tests run: 6, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 32.05 s <<< FAILURE! -- in org.apache.pulsar.client.impl.ClientCnxTest
Error: org.apache.pulsar.client.impl.ClientCnxTest.testSupportsGetPartitionedMetadataWithoutAutoCreation -- Time elapsed: 0.255 s <<< FAILURE!
java.lang.AssertionError: Expected an error that the broker version is too old.
at org.testng.Assert.fail(Assert.java:110)
at org.apache.pulsar.client.impl.ClientCnxTest.testSupportsGetPartitionedMetadataWithoutAutoCreation(ClientCnxTest.java:264)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47)
at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76)
at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
```
This test was added in #22773 and it seems to test what is defined in [PIP-344 Backward and Forward compatibility](https://github.com/apache/pulsar/blob/master/pip/pip-344.md#backward--forward-compatibility):
> - New version client and Old version Broker: The feature flag `supports_binary_api_get_partitioned_meta_with_param_created_false` will be `false`. The client will get a not-support error if the param `createIfAutoCreationEnabled` is false.
@poorbarcode would it be possible to explain the reason why the client should fail in this case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] Make auto partitions update work for old brokers without PIP-344 [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24822:
URL: https://github.com/apache/pulsar/pull/24822#issuecomment-3380539266
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24822?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.29%. Comparing base ([`008e4eb`](https://app.codecov.io/gh/apache/pulsar/commit/008e4ebbaf5808c0f859dddabd8382991f32d3aa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6086925`](https://app.codecov.io/gh/apache/pulsar/commit/608692559abdbb556ac3c0a411e9c6b52d311fee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 3 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24822?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24822 +/- ##
============================================
- Coverage 74.42% 74.29% -0.13%
- Complexity 33488 33801 +313
============================================
Files 1912 1912
Lines 149077 149089 +12
Branches 17300 17300
============================================
- Hits 110950 110769 -181
- Misses 29331 29482 +151
- Partials 8796 8838 +42
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24822/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24822/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.38% <0.00%> (-0.33%)` | :arrow_down: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24822/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.71% <0.00%> (-0.18%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24822/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.83% <100.00%> (-0.11%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/24822?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...rg/apache/pulsar/client/impl/PulsarClientImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/24822?src=pr&el=tree&filepath=pulsar-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fimpl%2FPulsarClientImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1B1bHNhckNsaWVudEltcGwuamF2YQ==) | `76.11% <100.00%> (ø)` | |
... and [91 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24822/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] Make auto partitions update work for old brokers without PIP-344 [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #24822:
URL: https://github.com/apache/pulsar/pull/24822
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org