madrob commented on a change in pull request #1702:
URL: https://github.com/apache/lucene-solr/pull/1702#discussion_r463410424



##########
File path: solr/core/src/java/org/apache/solr/filestore/PackageStoreAPI.java
##########
@@ -131,6 +131,53 @@ public void validateFiles(List<String> files, boolean 
validateSignatures, Consum
 
     static final String TMP_ZK_NODE = "/packageStoreWriteInProgress";
 
+    @EndPoint(
+            path = "/cluster/files/*",
+            method = SolrRequest.METHOD.DELETE,
+            permission = PermissionNameProvider.Name.FILESTORE_WRITE_PERM)
+    public void delete(SolrQueryRequest req, SolrQueryResponse rsp) {
+      if (!coreContainer.getPackageLoader().getPackageAPI().isEnabled()) {
+        throw new RuntimeException(PackageAPI.ERR_MSG);
+      }
+
+      try {
+        coreContainer.getZkController().getZkClient().create(TMP_ZK_NODE, 
"true".getBytes(UTF_8),

Review comment:
       do we use this for locking? no no no. we should be using zk versions for 
that.
   
   I understand that the code may have been in place before, but we need to fix 
it then before we can add additional features on top of this. it will add so 
much trouble.

##########
File path: solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
##########
@@ -470,13 +473,48 @@ public void syncToAllNodes(String path) throws 
IOException {
     return fileDetails;
   }
 
+  @Override
+  public void delete(String path) {
+    checkInZk(path);

Review comment:
       don't need this since deleteLocal will also call checkInZk?

##########
File path: 
solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
##########
@@ -68,12 +65,13 @@ public void teardown() {
     System.clearProperty("enable.packages");
   }
   
-  @SuppressWarnings({"unchecked"})
+  @SuppressWarnings({"unchecked", "rawtypes"})

Review comment:
       is this necessary?

##########
File path: 
solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
##########
@@ -39,15 +40,11 @@
 import org.apache.zookeeper.server.ByteBufferInputStream;
 import org.junit.After;
 import org.junit.Before;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
 import java.nio.file.Paths;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;

Review comment:
       please configure your IDE to not do this

##########
File path: 
solr/core/src/test/org/apache/solr/filestore/TestDistribPackageStore.java
##########
@@ -68,12 +65,13 @@ public void teardown() {
     System.clearProperty("enable.packages");
   }
   
-  @SuppressWarnings({"unchecked"})
+  @SuppressWarnings({"unchecked", "rawtypes"})
   public void testPackageStoreManagement() throws Exception {
     MiniSolrCloudCluster cluster =
         configureCluster(4)
         .withJettyConfig(jetty -> jetty.enableV2(true))
         .addConfig("conf", configset("cloud-minimal"))
+        .addConfig("conf", configset("cloud-minimal"))

Review comment:
       vestigial?




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



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

Reply via email to