Skip to content

[fix][broker] Fix inconsensus namespace policies by getPoliciesIfCached - #20855

Merged
mattisonchao merged 11 commits into
apache:masterfrom
mattisonchao:inconsensus_ns_policy/fix
Jul 25, 2023
Merged

[fix][broker] Fix inconsensus namespace policies by getPoliciesIfCached#20855
mattisonchao merged 11 commits into
apache:masterfrom
mattisonchao:inconsensus_ns_policy/fix

Conversation

@mattisonchao

@mattisonchao mattisonchao commented Jul 22, 2023

Copy link
Copy Markdown
Member

Motivation

#12339 Change some metadata blocking calls to get from the cache. And then #14154 add the cache expires. It will introduce inconsistent namespace policies problem when the cache is missed.

Modifications

  • Deprecated All of getPoliciesIfCached related logic, then use xxxAsync instead of it.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

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

@mattisonchao mattisonchao self-assigned this Jul 22, 2023
@mattisonchao
mattisonchao marked this pull request as ready for review July 22, 2023 18:20
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jul 22, 2023
@mattisonchao mattisonchao added this to the 3.2.0 milestone Jul 22, 2023

@poorbarcode poorbarcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch, could you add a test?

Comment thread pulsar-common/src/main/java/org/apache/pulsar/common/util/CompletableFutures.java Outdated
@mattisonchao
mattisonchao requested a review from poorbarcode July 25, 2023 02:39
@mattisonchao

Copy link
Copy Markdown
Member Author

Good catch, could you add a test?

#20843 has already added a test to prove the cache problem. we should avoid using this API to get inconsistent namespace policies.

@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.1.0 Jul 25, 2023
Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java Outdated
Comment thread pulsar-common/src/main/java/org/apache/pulsar/common/util/CompletableFutures.java Outdated
Comment thread pulsar-common/src/main/java/org/apache/pulsar/common/util/CompletableFutures.java Outdated
Comment thread pulsar-common/src/main/java/org/apache/pulsar/common/util/CompletableFutures.java Outdated
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.

6 participants