[fix][broker] Fix inconsistent topic policy - #21231
Merged
codelipenghui merged 31 commits intoSep 26, 2023
Merged
Conversation
5 tasks
mattisonchao
marked this pull request as draft
September 22, 2023 04:01
Member
Author
|
I need do some changes for fixing performance issue. |
Member
|
Since |
Member
Author
|
@coderzc Yep, you are right. I will do it in another PR. |
mattisonchao
requested review from
315157973,
Technoboy-,
codelipenghui,
coderzc and
hangc0276
and removed request for
coderzc
September 22, 2023 08:56
coderzc
approved these changes
Sep 22, 2023
This was referenced Sep 26, 2023
Contributor
|
The methods before were not async? |
2 tasks
poorbarcode
pushed a commit
that referenced
this pull request
Oct 7, 2023
(cherry picked from commit afc9244)
poorbarcode
added a commit
that referenced
this pull request
Oct 7, 2023
This reverts commit a0e2104.
Member
Author
Yes, it was used backoff to implement an async-like approach. |
liangyuanpeng
pushed a commit
to liangyuanpeng/pulsar
that referenced
this pull request
Oct 11, 2023
Technoboy-
pushed a commit
that referenced
this pull request
Oct 19, 2023
5 tasks
codelipenghui
pushed a commit
that referenced
this pull request
Nov 8, 2023
### Motivation PR #21231 made user topic creation rely on system topic `__change_event` if the user is enabling `topicLevelPoliciesEnabled`. It will introduce a race condition with namespace bundle unloading. All creating topics want to create `__change_event` reader but constantly fail by namespace-bundle inactive and retry mechanism. Unfortunately, the namespace-bundle unloading operation is waiting for all the topics to be completed and then release inactive status. Therefore, they will be stuck in a deadlock until one gets a timeout. ### Modifications - Get the topic policy before loading.
Technoboy-
pushed a commit
that referenced
this pull request
Nov 10, 2023
PR #21231 made user topic creation rely on system topic `__change_event` if the user is enabling `topicLevelPoliciesEnabled`. It will introduce a race condition with namespace bundle unloading. All creating topics want to create `__change_event` reader but constantly fail by namespace-bundle inactive and retry mechanism. Unfortunately, the namespace-bundle unloading operation is waiting for all the topics to be completed and then release inactive status. Therefore, they will be stuck in a deadlock until one gets a timeout. - Get the topic policy before loading.
nborisov
pushed a commit
to nborisov/pulsar
that referenced
this pull request
Nov 13, 2023
…21445) ### Motivation PR apache#21231 made user topic creation rely on system topic `__change_event` if the user is enabling `topicLevelPoliciesEnabled`. It will introduce a race condition with namespace bundle unloading. All creating topics want to create `__change_event` reader but constantly fail by namespace-bundle inactive and retry mechanism. Unfortunately, the namespace-bundle unloading operation is waiting for all the topics to be completed and then release inactive status. Therefore, they will be stuck in a deadlock until one gets a timeout. ### Modifications - Get the topic policy before loading.
nikhil-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Dec 20, 2023
nikhil-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Dec 20, 2023
…21445) PR apache#21231 made user topic creation rely on system topic `__change_event` if the user is enabling `topicLevelPoliciesEnabled`. It will introduce a race condition with namespace bundle unloading. All creating topics want to create `__change_event` reader but constantly fail by namespace-bundle inactive and retry mechanism. Unfortunately, the namespace-bundle unloading operation is waiting for all the topics to be completed and then release inactive status. Therefore, they will be stuck in a deadlock until one gets a timeout. - Get the topic policy before loading.
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Dec 20, 2023
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Dec 20, 2023
…21445) PR apache#21231 made user topic creation rely on system topic `__change_event` if the user is enabling `topicLevelPoliciesEnabled`. It will introduce a race condition with namespace bundle unloading. All creating topics want to create `__change_event` reader but constantly fail by namespace-bundle inactive and retry mechanism. Unfortunately, the namespace-bundle unloading operation is waiting for all the topics to be completed and then release inactive status. Therefore, they will be stuck in a deadlock until one gets a timeout. - Get the topic policy before loading.
15 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
#7817 Introduced topic-level policy for a managed-config with a bug. Which can lead to an unexpected data retention policy If the pulsar topic policy service isn't initialized.
Modifications
CompletableFuture<Optional<TopicPolicies>> getTopicPoliciesAsync(@Nonnull TopicName topicName, boolean isGlobal);CompletableFuture<Optional<TopicPolicies>> getTopicPoliciesAsync(@Nonnull TopicName topicName);Verifying this change
Alternatives
TopicPoliciesService#CompletableFuture<Optional<TopicPolicies>> getTopicPoliciesAsyncWithRetry(TopicName topicName, final Backoff backoff, ScheduledExecutorService scheduledExecutorService, boolean isGlobal)method.Documentation
docdoc-requireddoc-not-neededdoc-complete