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

[fix][admin] Listen partitioned topic creation event #23680

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

nodece
Copy link
Member

@nodece nodece commented Dec 4, 2024

Motivation

I have a broker interceptor, which will add a topic event listener to listen the topic creation in the org.apache.pulsar.broker.intercept.BrokerInterceptor#initialize. However, the partitioned topic creation event can not be recorded(bin/pulsar-admin topics create-partitioned-topic -p 3 test-topic-event).

pulsar.getBrokerService().addTopicEventListener((topic, event, stage, t) -> {
            log.info("got event {}__{} for topic {}", event, stage, topic);
});

The non-partitioned topic works fine.

Modifications

  • Call topicEventsDispatcher with the TopicEvent.CREATE and EventStage.BEFORE before creating the persistent/non-persistent partitioned topic.
  • Call topicEventsDispatcher with the TopicEvent.CREATE and EventStage.SUCCESS/FAILURE after the persistent/non-persistent partitioned topic is created.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 4, 2024
@nodece
Copy link
Member Author

nodece commented Dec 5, 2024

/pulsarbot rerun-failure-checks

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.43%. Comparing base (bbc6224) to head (9cedf59).
Report is 780 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23680      +/-   ##
============================================
+ Coverage     73.57%   74.43%   +0.85%     
- Complexity    32624    35089    +2465     
============================================
  Files          1877     1945      +68     
  Lines        139502   147448    +7946     
  Branches      15299    16269     +970     
============================================
+ Hits         102638   109750    +7112     
- Misses        28908    29231     +323     
- Partials       7956     8467     +511     
Flag Coverage Δ
inttests 27.24% <100.00%> (+2.65%) ⬆️
systests 24.38% <70.00%> (+0.06%) ⬆️
unittests 73.80% <100.00%> (+0.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../org/apache/pulsar/broker/admin/AdminResource.java 77.27% <100.00%> (-0.36%) ⬇️

... and 666 files with indirect coverage changes

@nodece nodece merged commit 0a2ffe4 into apache:master Dec 8, 2024
59 checks passed
@nodece nodece added this to the 4.1.0 milestone Dec 8, 2024
@nodece nodece self-assigned this Dec 8, 2024
lhotari pushed a commit that referenced this pull request Dec 11, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 0a2ffe4)
lhotari pushed a commit that referenced this pull request Dec 11, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 0a2ffe4)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 12, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 0a2ffe4)
(cherry picked from commit 7dcc255)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 12, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 0a2ffe4)
(cherry picked from commit 7dcc255)
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.

5 participants