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 2021/12/19 05:04:15 UTC

[GitHub] [pulsar] Jason918 opened a new pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Jason918 opened a new pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   
   ### Motivation
   
   There are some direct usages of zookeeper in brokers, these should be fixed as we supports multi metadata store implementations now.
   
   ### Modifications
   
   Add a common `deleteIgnoreNotFoundAsync` in `BaseResources` which will not throw exception while deleting a non-exists path.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
     
   - [x] `no-need-doc` 
   Bug fix.


-- 
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] merlimat commented on a change in pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394#discussion_r772533776



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java
##########
@@ -152,6 +152,20 @@ protected void delete(String path) throws MetadataStoreException {
         return cache.delete(path);
     }
 
+    protected CompletableFuture<Void> deleteIfExistsAsync(String path) {
+        CompletableFuture<Void> future = new CompletableFuture<>();
+        cache.delete(path).whenComplete((ignore, ex) -> {

Review comment:
       👍 We could also do a check for `exists()` before the delete.




-- 
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] merlimat merged pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394


   


-- 
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] Jason918 commented on a change in pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Posted by GitBox <gi...@apache.org>.
Jason918 commented on a change in pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394#discussion_r772770709



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java
##########
@@ -152,6 +152,20 @@ protected void delete(String path) throws MetadataStoreException {
         return cache.delete(path);
     }
 
+    protected CompletableFuture<Void> deleteIfExistsAsync(String path) {
+        CompletableFuture<Void> future = new CompletableFuture<>();
+        cache.delete(path).whenComplete((ignore, ex) -> {

Review comment:
       Updated




-- 
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] codelipenghui commented on a change in pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394#discussion_r772116253



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java
##########
@@ -152,6 +152,20 @@ protected void delete(String path) throws MetadataStoreException {
         return cache.delete(path);
     }
 
+    protected CompletableFuture<Void> deleteIgnoreNotFoundAsync(String path) {

Review comment:
       How about deleteIfExists(String path)




-- 
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] Jason918 commented on pull request #13394: [broker] Fix compatibility issue with other metadata store implementations in resources

Posted by GitBox <gi...@apache.org>.
Jason918 commented on pull request #13394:
URL: https://github.com/apache/pulsar/pull/13394#issuecomment-997952668


   /pulsarbot run-failure-checks


-- 
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