You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/03/14 01:28:31 UTC

[GitHub] [lucene-solr] andyvuong commented on a change in pull request #1317: SOLR-13101: Create metadataSuffix znode only at common shard creating api calls

andyvuong commented on a change in pull request #1317: SOLR-13101: Create metadataSuffix znode only at common shard creating api calls
URL: https://github.com/apache/lucene-solr/pull/1317#discussion_r392544473
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/store/shared/metadata/SharedShardMetadataController.java
 ##########
 @@ -146,20 +148,18 @@ public void cleanUpMetadataNodes(String collectionName, String shardName) {
     }
   }
 
-  private void createPersistentNodeIfNonExistent(String path, byte[] data) {
+  private void createPersistentNode(String path, byte[] data) {
     try {
       if (!stateManager.hasData(path)) {
-        try {
-          stateManager.makePath(path, data, CreateMode.PERSISTENT, /* failOnExists */ false);
-        } catch (AlreadyExistsException e) {
-          // it's okay if another beats us creating the node
-        }
+        stateManager.makePath(path, data, CreateMode.PERSISTENT, /* failOnExists */ true);
 
 Review comment:
   #makePath will also throw an AlreadyExistsException if the node exists and failOnExists=true

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org