-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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][broker] Fix inconsistent topic policy #21231
Merged
codelipenghui
merged 31 commits into
apache:master
from
mattisonchao:fix/topic_policy_not_apply
Sep 26, 2023
Merged
[fix][broker] Fix inconsistent topic policy #21231
codelipenghui
merged 31 commits into
apache:master
from
mattisonchao:fix/topic_policy_not_apply
Sep 26, 2023
+478
−197
Conversation
This file contains 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
mattisonchao
added
type/bug
The PR fixed a bug or issue reported a bug
area/broker
category/reliability
The function does not work properly in certain specific environments or failures. e.g. data lost
labels
Sep 21, 2023
5 tasks
I need do some changes for fixing performance issue. |
Since |
@coderzc Yep, you are right. I will do it in another PR. |
mattisonchao
requested review from
coderzc,
315157973,
hangc0276,
Technoboy- and
codelipenghui
and removed request for
coderzc
September 22, 2023 08:56
coderzc
approved these changes
Sep 22, 2023
This was referenced Sep 26, 2023
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
category/reliability
The function does not work properly in certain specific environments or failures. e.g. data lost
cherry-picked/branch-2.10
cherry-picked/branch-2.11
cherry-picked/branch-3.0
cherry-picked/branch-3.1
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/2.10.6
release/2.11.3
release/3.0.2
release/3.1.2
type/bug
The PR fixed a bug or issue reported a bug
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
doc
doc-required
doc-not-needed
doc-complete