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


With regards,
Apache Git Services

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

Reply via email to