[Branch-2.7] Fixed deadlock on metadata cache missing while doing checkReplication #16889
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.
Motivation
The origin PR #12484 is merged into branch 2.7, but reverted in #16882 because Unit test
BrokerBookieIsolationTest#testBookieIsilationWithSecondaryGroup
fails.The root cause is that
policies
andlocalPolicies
are not updated after they are read from async process.Modifications
optPolicies, optLocalPolicies
topolicies, localPolicies
inhttps://github.com/merlimat/pulsar/blob/f53ddc13d7fb28f4c1bd73b23e7f3d8b7fc35591/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L1209
Verifying this change
This change is already covered by existing tests, such as BrokerBookieIsolationTest#testBookieIsilationWithSecondaryGroup
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-not-needed
bug fix.