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 2022/03/28 06:46:22 UTC

[GitHub] [pulsar] wangjialing218 commented on a change in pull request #14903: fix MetadataStore#put may get unexcepted exception

wangjialing218 commented on a change in pull request #14903:
URL: https://github.com/apache/pulsar/pull/14903#discussion_r836099445



##########
File path: pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java
##########
@@ -386,7 +386,13 @@ private void internalStorePut(OpPut opPut) {
                                 put(opPut.getPath(), opPut.getData(), Optional.of(-1L)).thenAccept(
                                                 s -> future.complete(s))
                                         .exceptionally(ex -> {
-                                            future.completeExceptionally(MetadataStoreException.wrap(ex.getCause()));
+                                            if (ex instanceof BadVersionException) {

Review comment:
       The code here is handling the put request without `expectedVersion`, that means the put operation should succeed in case of concurrent write. we should not throw BadVersionException here, which means the expected version doesn't match the actual version of the data.




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