rdhabalia commented on a change in pull request #9501:
URL: https://github.com/apache/pulsar/pull/9501#discussion_r574840078



##########
File path: 
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java
##########
@@ -213,7 +214,7 @@ public ZKMetadataStore(ZooKeeper zkc) {
                                     future.complete(new Stat(name, 0, 0, 0));
                                 } else if (code == Code.NODEEXISTS) {
                                     // We're emulating a request to create 
node, so the version is invalid
-                                    
future.completeExceptionally(getException(Code.BADVERSION, path));
+                                    
future.completeExceptionally(getException(Code.NODEEXISTS, path));

Review comment:
       we can handle `BADVERSION` as `NODEEXISTS` at caller side. but my only 
concern was what exact benefit we can get  by returning different error-code. 
because actual error (in this case AlreadyExist) can help better in handling 
failure rather than deriving from `BADVERSION` . I will try to change handling 
at caller side but I think we might have usecases in future to explicitly know 
specific error to handle the failure.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to