GeezerVison is showing github.com — [fix][broker] PIP-428: Fix corrupted topic policies issues with sequential topic policy updates by lhotari · Pull Request #24427 · apache/pulsar
Conversation
lhotari
commented
Jun 18, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #24393
Fixes #21303
Motivation
There's a long time issue where topic policies get corrupted as a result of sequential or concurrent topic policy updates.
This PR contains the implementation of
"PIP-428: Change TopicPoliciesService interface to fix consistency issues". Please refer to the PIP document at https://github.com/apache/pulsar/blob/master/pip/pip-428.md for the broader context.
Modifications
Documentation
-
doc
-
doc-required
-
doc-not-needed
-
doc-complete
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Technoboy- reacted with thumbs up emoji
|
❌ Patch coverage is 85.30702% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.31%. Comparing base (95dcb58) to head (a4d3924).
⚠️ Report is 35 commits behind head on master.
Additional details and impacted files

@@ Coverage Diff @@
## master #24427 +/- ##
============================================
+ Coverage 73.74% 74.31% +0.57%
- Complexity 33174 33224 +50
============================================
Files 1857 1885 +28
Lines 146500 146943 +443
Branches 16835 16927 +92
============================================
+ Hits 108041 109208 +1167
+ Misses 29828 29034 -794
- Partials 8631 8701 +70
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 212 files with indirect coverage changes
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lhotari
changed the title
[WIP][fix][broker] Fix corrupted topic policies issues with sequential topic policy updates
[fix][broker] Fix corrupted topic policies issues with sequential topic policy updates
Jun 24, 2025
BewareMyPower
changed the title
[fix][broker] Fix corrupted topic policies issues with sequential topic policy updates
[fix][broker] PIP-428: Fix corrupted topic policies issues with sequential topic policy updates
Aug 25, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…dateWhenTopicPolicyDoesntExist parameter
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…nedTopic
- it was relying on previously invalid behavior
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@lhotari This PR fixes NullPointerException:
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.atomic.AtomicInteger.incrementAndGet()" because the return value of "java.util.Map.get(Object)" is null
at org.apache.pulsar.broker.service.SystemTopicBasedTopicPoliciesService.addOwnedNamespaceBundleAsync(SystemTopicBasedTopicPoliciesService.java:405) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.service.SystemTopicBasedTopicPoliciesService$2.onLoad(SystemTopicBasedTopicPoliciesService.java:509) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.namespace.NamespaceService.notifyNamespaceBundleOwnershipListener(NamespaceService.java:1322) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.namespace.NamespaceService.onNamespaceBundleOwned(NamespaceService.java:1285) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.namespace.OwnershipCache.lambda$tryAcquiringOwnership$3(OwnershipCache.java:218) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[?:?]
at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[?:?]
at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[?:?]
at org.apache.pulsar.broker.namespace.OwnershipCache.tryAcquiringOwnership(OwnershipCache.java:216) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.namespace.NamespaceService.searchForCandidateBroker(NamespaceService.java:631) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at org.apache.pulsar.broker.namespace.NamespaceService.lambda$findBrokerServiceUrl$10(NamespaceService.java:466) ~[pulsar-broker.jar:3.0.14-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.124.Final.jar:4.1.124.Final]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
Do you consider fixing this on the branch-3.0?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Do you consider fixing this on the branch-3.0?
@nodece please propose on the mailing list
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@lhotari, It seems that fixing the NullPointerException may be sufficient.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I submitted #24758 to the branch-3.0.
|
lhotari reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Demogorgon314
added a commit
to Demogorgon314/kop
that referenced
this pull request
Apr 15, 2026
### Motivation
apache/pulsar#24623:
Updated:
```
public static EntryImpl create(Position position, ByteBuf data)
```
to
```
public static EntryImpl create(Position position, ByteBuf data, int expectedReadCount)
```
apache/pulsar#24427:
Updated:
```
CompletableFuture<Void> updateTopicPoliciesAsync(TopicName topicName, TopicPolicies policies);
```
to
```
CompletableFuture<Void> updateTopicPoliciesAsync(TopicName topicName,
boolean isGlobalPolicy,
boolean skipUpdateWhenTopicPolicyDoesntExist,
Consumer<TopicPolicies> policyUpdater);
```
### Modifications
Fix build issue caused by upstream interface changes
This was referenced Oct 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|