You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2023/01/04 12:11:34 UTC

[GitHub] [pulsar] nicoloboschi opened a new pull request, #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

nicoloboschi opened a new pull request, #19129:
URL: https://github.com/apache/pulsar/pull/19129

   ### Motivation
   
   There's blind spot in the topic deletion where, if an exception occurs during the partitioned metadata update, the topics ends in a fenced state and it can't be deleted or used. With a broker restarts, the topic is deletable again. However the topic might be in an inconsistent state.
   
   ### Modifications
   
   * Removed fenced flag in the topic if an error occurs during the partition metadata update
   * Add unit test
   * (tests) Fix `FaultInjectionMetadataStore` to be usable also from the MetadataCache methods 
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on code in PR #19129:
URL: https://github.com/apache/pulsar/pull/19129#discussion_r1061475078


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1289,6 +1289,11 @@ public void deleteLedgerComplete(Object ctx) {
                 });
 
                 return deleteFuture;
+                }).whenComplete((value, ex) -> {
+                    if (ex != null) {
+                        unfenceTopicToResume();
+                        log.error("[{}] Error deleting topic", topic, ex);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] eolivelli commented on a diff in pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by GitBox <gi...@apache.org>.
eolivelli commented on code in PR #19129:
URL: https://github.com/apache/pulsar/pull/19129#discussion_r1061460903


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1289,6 +1289,11 @@ public void deleteLedgerComplete(Object ctx) {
                 });
 
                 return deleteFuture;
+                }).whenComplete((value, ex) -> {
+                    if (ex != null) {
+                        unfenceTopicToResume();
+                        log.error("[{}] Error deleting topic", topic, ex);

Review Comment:
   It is better to log before calling unfenceTopicToResume



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1289,6 +1289,11 @@ public void deleteLedgerComplete(Object ctx) {
                 });
 
                 return deleteFuture;
+                }).whenComplete((value, ex) -> {

Review Comment:
   nit: you could use 'exceptionally'
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] eolivelli merged pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by GitBox <gi...@apache.org>.
eolivelli merged PR #19129:
URL: https://github.com/apache/pulsar/pull/19129


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on code in PR #19129:
URL: https://github.com/apache/pulsar/pull/19129#discussion_r1061473275


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1289,6 +1289,11 @@ public void deleteLedgerComplete(Object ctx) {
                 });
 
                 return deleteFuture;
+                }).whenComplete((value, ex) -> {

Review Comment:
   exceptionally swallows the exception so it's not a good fit here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] liangyepianzhou commented on pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by "liangyepianzhou (via GitHub)" <gi...@apache.org>.
liangyepianzhou commented on PR #19129:
URL: https://github.com/apache/pulsar/pull/19129#issuecomment-1422206389

   >So this PR does not need to cherry-pick to branch2.10, right?
   
   @nicoloboschi I see the partitioned metadata update when topic deleted is introduced by https://github.com/apache/pulsar/pull/18193 that does not cherry-pick to branch-2.10. So this PR neither needs to cherry-pick to branch2.10, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] codecov-commenter commented on pull request #19129: [fix][broker] Topic could be in fenced state forever if deletion fails

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19129:
URL: https://github.com/apache/pulsar/pull/19129#issuecomment-1370940138

   # [Codecov](https://codecov.io/gh/apache/pulsar/pull/19129?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19129](https://codecov.io/gh/apache/pulsar/pull/19129?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e39570) into [master](https://codecov.io/gh/apache/pulsar/commit/feb3cb4d7a484a284e06474713870609b220abfc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (feb3cb4) will **decrease** coverage by `9.10%`.
   > The diff coverage is `5.55%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/pulsar/pull/19129/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/pulsar/pull/19129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #19129      +/-   ##
   ============================================
   - Coverage     46.35%   37.24%   -9.11%     
   + Complexity     8939     1991    -6948     
   ============================================
     Files           597      209     -388     
     Lines         56858    14452   -42406     
     Branches       5905     1577    -4328     
   ============================================
   - Hits          26357     5383   -20974     
   + Misses        27616     8485   -19131     
   + Partials       2885      584    -2301     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | unittests | `37.24% <5.55%> (-9.11%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | `15.06% <0.00%> (-0.03%)` | :arrow_down: |
   | [...he/pulsar/client/impl/MultiTopicsConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL011bHRpVG9waWNzQ29uc3VtZXJJbXBsLmphdmE=) | `22.80% <0.00%> (+0.01%)` | :arrow_up: |
   | [...ache/pulsar/client/impl/ZeroQueueConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1plcm9RdWV1ZUNvbnN1bWVySW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...va/org/apache/pulsar/client/impl/ConsumerBase.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVyQmFzZS5qYXZh) | `21.51% <6.66%> (-0.42%)` | :arrow_down: |
   | [.../pulsar/client/impl/BatchMessageContainerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0JhdGNoTWVzc2FnZUNvbnRhaW5lckltcGwuamF2YQ==) | `55.95% <0.00%> (-1.02%)` | :arrow_down: |
   | [.../java/org/apache/pulsar/client/impl/ClientCnx.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NsaWVudENueC5qYXZh) | `29.97% <0.00%> (ø)` | |
   | [...rg/apache/pulsar/broker/delayed/bucket/Bucket.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9CdWNrZXQuamF2YQ==) | | |
   | [.../pulsar/broker/service/BrokerServiceException.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0Jyb2tlclNlcnZpY2VFeGNlcHRpb24uamF2YQ==) | | |
   | [...va/org/apache/pulsar/broker/service/ServerCnx.java](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1NlcnZlckNueC5qYXZh) | | |
   | ... and [392 more](https://codecov.io/gh/apache/pulsar/pull/19129/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org