AndreyBozhko commented on code in PR #2707:
URL: https://github.com/apache/solr/pull/2707#discussion_r1755442168


##########
solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java:
##########
@@ -145,6 +145,10 @@ public void process(WatchedEvent event) {
           log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK");
           return;
         }
+        if (e.code() == KeeperException.Code.NONODE) {
+          log.warn("ZooKeeper watch triggered, but schema does not exist in ZK 
- skipping update");
+          return;
+        }

Review Comment:
   Test failure:
   ```
      >     com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured 
an uncaught exception in thread: Thread[id=402, name=zkCallback-144-thread-2, 
state=RUNNABLE, group=TGRP-TestCloudConsistency]
      >         at 
__randomizedtesting.SeedInfo.seed([C86BB29C87FB4A74:B680928C449C454E]:0)
      > 
      >         Caused by:
      >         org.apache.solr.common.cloud.ZooKeeperException: 
      >             at __randomizedtesting.SeedInfo.seed([C86BB29C87FB4A74]:0)
      >             at 
app//org.apache.solr.schema.ZkIndexSchemaReader$SchemaWatcher.process(ZkIndexSchemaReader.java:149)
      >             at 
app//org.apache.solr.common.cloud.SolrZkClient$ProcessWatchWithExecutor.lambda$process$1(SolrZkClient.java:1083)
      >             at 
app//org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$1(ExecutorUtil.java:449)
      >             at 
java.base@21.0.4/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
      >             at 
java.base@21.0.4/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
      >             at java.base@21.0.4/java.lang.Thread.run(Thread.java:1583)
      > 
      >             Caused by:
      >             org.apache.zookeeper.KeeperException$NoNodeException: 
KeeperErrorCode = NoNode for 
/configs/outOfSyncReplicasCannotBecomeLeader-false.AUTOCREATED/managed-schema.xml
      >                 at 
app//org.apache.zookeeper.KeeperException.create(KeeperException.java:117)
      >                 at 
app//org.apache.zookeeper.KeeperException.create(KeeperException.java:53)
      >                 at 
app//org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1972)
      >                 at 
app//org.apache.solr.common.cloud.SolrZkClient.lambda$getData$6(SolrZkClient.java:448)
      >                 at 
app//org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:70)
      >                 at 
app//org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:448)
      >                 at 
app//org.apache.solr.schema.ZkIndexSchemaReader.updateSchema(ZkIndexSchemaReader.java:176)
      >                 at 
app//org.apache.solr.schema.ZkIndexSchemaReader$SchemaWatcher.process(ZkIndexSchemaReader.java:141)
      >                 ... 5 more
   
   Reproduce with: ./gradlew :solr:core:test --tests 
"org.apache.solr.cloud.TestCloudConsistency.testOutOfSyncReplicasCannotBecomeLeader"
 -Ptests.jvms=6 "-Ptests.jvmargs=-XX:TieredStopAtLevel=1 -XX:+UseParallelGC 
-XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m" 
-Ptests.seed=985B588C69AC93B2 -Ptests.file.encoding=ISO-8859-1
   
   ```



##########
solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java:
##########
@@ -145,6 +145,10 @@ public void process(WatchedEvent event) {
           log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK");
           return;
         }
+        if (e.code() == KeeperException.Code.NONODE) {
+          log.warn("ZooKeeper watch triggered, but schema does not exist in ZK 
- skipping update");
+          return;
+        }

Review Comment:
   Updated the watcher logic to handle situation when the schema node was 
deleted.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to