epugh commented on code in PR #3904:
URL: https://github.com/apache/solr/pull/3904#discussion_r2659738322


##########
solr/core/src/test/org/apache/solr/cloud/DeleteCoreRemnantsOnCreateTest.java:
##########
@@ -0,0 +1,259 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.cloud;
+
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Optional;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.common.cloud.DocCollection;
+import org.apache.solr.common.cloud.Replica;
+import org.apache.solr.common.cloud.Slice;
+import org.apache.solr.core.CoreDescriptor;
+import org.apache.solr.core.SolrCore;
+import org.apache.solr.embedded.JettySolrRunner;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Solr occasionally gets into an inconsistent state with its cores lifecycle 
where remnant files
+ * are left on disk after various operations that delete a core. Examples 
include deleting a
+ * collection operation that doesn't properly finish, or maybe the Solr 
process unexpectedly gets
+ * killed. The system property "solr.cloud.delete.unknown.cores.enabled" is an 
expert setting that
+ * when enabled automatically deletes any remnant core data on disk when new 
cores are created that
+ * would otherwise fail due to the preexisting files. You should be cautious 
in enabling this
+ * feature, as it means that something isn't working well in your Solr setup.
+ */
+public class DeleteCoreRemnantsOnCreateTest extends SolrCloudTestCase {
+  private static final String DELETE_UNKNOWN_CORES_PROP = 
"solr.cloud.delete.unknown.cores.enabled";
+
+  @BeforeClass
+  public static void setupCluster() throws Exception {
+    configureCluster(1).addConfig("conf", 
configset("cloud-minimal")).configure();
+  }
+
+  @Before

Review Comment:
   I wondered about that as well, and then got the "well, maybe it is 
requried", I should have tried removing it!



-- 
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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to