-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix update topic partitions failed #15217
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
Conversation
|
@takahiro0208:Thanks for your contribution. For this PR, do we need to update docs? |
|
@takahiro0208:Thanks for providing doc info! |
|
@takahiro0208 I think the proper way is, |
|
| }); | ||
| result.completeExceptionally(ex2); | ||
| return null; | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updatePartitionedTopicAsync has handled the exception, so it can't delegate the exception here.
BTW, could you help refactor this method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it do not handle since the code between 4033-4035 also delegate the exception. And I think I can help refactor this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takahiro0208 If createSubscriptions failed, there would be a situation which sub Znode under managed-ledgers had created. your deletion here will fail also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takahiro0208 If
createSubscriptionsfailed, there would be a situation which sub Znode under managed-ledgers had created. your deletion here will fail also.
If we use "force=true" to retry updatePartition, it seems no need to clean-up znode ?
868a6fa to
e90def9
Compare
|
I have updated the code, PTAL, @gaozhangmin @Technoboy- @rdhabalia
|
|
The pr had no activity for 30 days, mark with Stale label. |
|
The pr had no activity for 30 days, mark with Stale label. |
|
@TakaHiR07 Please rebase the master and resolve the conflicts. |
|
pr-17251 is the similar method to solve update partition problem. So close this one |
Motivation
I encounter the same problem as #11682 described, and i notice two pr for it, #10374 and #11683
But I think they still remain problems.
Actually internalUpdatePartitionedTopic consist of three part:
Suppose there are subscriptions in a partitioned-topic and we want to update its partition.
If part 1, 2 succeed, part 3 failed, it need to clean up managed-ledger znode. But it would throw zookeeper Directory not empty exception when clean-up, since znode would has successfully created subscription children node.
And when we retrying updatePartition again, it would throw the below error because part 2 complete

So we need to retry updatePartition again with "force=true". The "Subscription already exists" error would be catch, and it complete the updatePartition operation, while permanently skip the part 3.
Modifications
After catch the "Subscription already exists" error, do updatePartitionedTopicAsync() operation
discussions
When adding 'force=true' , the managed-ledger znode clean up operation seems not neccessary and can be removed?
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
no-need-doc(Please explain why)