Skip to content

Conversation

@Dream95
Copy link
Contributor

@Dream95 Dream95 commented Nov 3, 2025

Fixes #24907

Motivation

The test code has an incorrect variable name,and re-registration will not happen until the ExtensibleLoadManagerImpl.monitorTask execute.

Modifications

Add re-register when session reestablished.

if (event == SessionEvent.SessionReestablished || event == SessionEvent.Reconnected) {
            this.registerAsyncWithRetries();
}

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository: Dream95#2

…sionRebuild (apache#24907)

Signed-off-by: Dream95 <zhou_8621@163.com>
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 3, 2025
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM. Good catch @Dream95! This looks like a production code bug in Extensible LoadManager's BrokerRegistryImpl since it didn't register to handle the reconnection event. For that reason, I think it's worth changing the title of the PR to describe this.

@lhotari lhotari added this to the 4.2.0 milestone Nov 3, 2025
@lhotari lhotari changed the title [fix][broker] Flaky-test: ZkSessionExpireTest.testTopicUnloadAfterSessionRebuild [fix][broker] ExtensibleLoadManager: handle SessionReestablished and Reconnected events to re-register broker metadata Nov 3, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.24%. Comparing base (fbc50b0) to head (77d4d0a).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...ker/loadbalance/extensions/BrokerRegistryImpl.java 50.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24932      +/-   ##
============================================
- Coverage     74.34%   74.24%   -0.11%     
- Complexity    33532    33880     +348     
============================================
  Files          1913     1913              
  Lines        149419   149427       +8     
  Branches      17356    17358       +2     
============================================
- Hits         111089   110941     -148     
- Misses        29480    29633     +153     
- Partials       8850     8853       +3     
Flag Coverage Δ
inttests 26.28% <12.50%> (-0.42%) ⬇️
systests 22.72% <0.00%> (-0.13%) ⬇️
unittests 73.78% <50.00%> (-0.09%) ⬇️

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

Files with missing lines Coverage Δ
...ker/loadbalance/extensions/BrokerRegistryImpl.java 80.14% <50.00%> (-3.32%) ⬇️

... and 90 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.

@lhotari lhotari merged commit 95c1dab into apache:master Nov 3, 2025
59 of 60 checks passed
@heesung-sohn
Copy link
Contributor

Great catch! Can we backport this to 3.3, 4.0, and 4.1?

@heesung-sohn
Copy link
Contributor

note: when the broker registry migrated to the metadata cache from the lock manager, this session handler logic was not captured.

ref: #23298

@lhotari
Copy link
Member

lhotari commented Nov 3, 2025

note: when the broker registry migrated to the metadata cache from the lock manager, this session handler logic was not captured.

ref: #23298

Oh yes, now I remember. #24057 was made to track the issue, but the creation of the metadata was missed.

lhotari pushed a commit that referenced this pull request Nov 4, 2025
…Reconnected events to re-register broker metadata (#24932)

Signed-off-by: Dream95 <zhou_8621@163.com>
(cherry picked from commit 95c1dab)
@lhotari
Copy link
Member

lhotari commented Nov 4, 2025

Not needed for branch-3.0 since #23298 isn't applied to that branch.

lhotari pushed a commit that referenced this pull request Nov 4, 2025
…Reconnected events to re-register broker metadata (#24932)

Signed-off-by: Dream95 <zhou_8621@163.com>
(cherry picked from commit 95c1dab)
lhotari pushed a commit that referenced this pull request Nov 4, 2025
…Reconnected events to re-register broker metadata (#24932)

Signed-off-by: Dream95 <zhou_8621@163.com>
(cherry picked from commit 95c1dab)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2025
…Reconnected events to re-register broker metadata (apache#24932)

Signed-off-by: Dream95 <zhou_8621@163.com>
(cherry picked from commit 95c1dab)
(cherry picked from commit 4df635a)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2025
…Reconnected events to re-register broker metadata (apache#24932)

Signed-off-by: Dream95 <zhou_8621@163.com>
(cherry picked from commit 95c1dab)
(cherry picked from commit 4df635a)
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.

Flaky-test: ZkSessionExpireTest.testTopicUnloadAfterSessionRebuild

4 participants