This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e597d48  Remove assertion on file deletion to trigger failure policy
e597d48 is described below

commit e597d48bda845815dada7cf53f705ae273d8f457
Author: Stefan Podkowinski <s.podkowin...@gmail.com>
AuthorDate: Wed Nov 21 14:05:55 2018 +0100

    Remove assertion on file deletion to trigger failure policy
    
     patch by Stefan Podkowinski; reviewed by Mick Semb Wever for 
CASSANDRA-15143
---
 CHANGES.txt                                                |  1 +
 src/java/org/apache/cassandra/audit/BinLogAuditLogger.java |  4 ++--
 src/java/org/apache/cassandra/io/util/FileUtils.java       | 13 +++++--------
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index e1d0ce6..db5e3dc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0-alpha3
+ * Better handling of file deletion failures by DiskFailurePolicy 
(CASSANDRA-15143)
  * Prevent read repair mutations from increasing read timeout (CASSANDRA-15442)
  * Document 4.0 system keyspace changes, bump generations (CASSANDRA-15454)
  * Make it possible to disable STCS-in-L0 during runtime (CASSANDRA-15445)
diff --git a/src/java/org/apache/cassandra/audit/BinLogAuditLogger.java 
b/src/java/org/apache/cassandra/audit/BinLogAuditLogger.java
index d43bb4a..94067fb 100644
--- a/src/java/org/apache/cassandra/audit/BinLogAuditLogger.java
+++ b/src/java/org/apache/cassandra/audit/BinLogAuditLogger.java
@@ -295,9 +295,9 @@ abstract class BinLogAuditLogger implements IAuditLogger
         {
             for (File f : fileOrDirectory.listFiles())
             {
-                accumulate = FileUtils.deleteWithConfirm(f, true, accumulate);
+                accumulate = FileUtils.deleteWithConfirm(f, accumulate);
             }
         }
-        return FileUtils.deleteWithConfirm(fileOrDirectory, true , accumulate);
+        return FileUtils.deleteWithConfirm(fileOrDirectory, accumulate);
     }
 }
diff --git a/src/java/org/apache/cassandra/io/util/FileUtils.java 
b/src/java/org/apache/cassandra/io/util/FileUtils.java
index 4652512..4bf42f0 100644
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@ -175,19 +175,16 @@ public final class FileUtils
         return f;
     }
 
-    public static Throwable deleteWithConfirm(String filePath, boolean expect, 
Throwable accumulate)
+    public static Throwable deleteWithConfirm(String filePath, Throwable 
accumulate)
     {
-        return deleteWithConfirm(new File(filePath), expect, accumulate);
+        return deleteWithConfirm(new File(filePath), accumulate);
     }
 
-    public static Throwable deleteWithConfirm(File file, boolean expect, 
Throwable accumulate)
+    public static Throwable deleteWithConfirm(File file, Throwable accumulate)
     {
-        boolean exists = file.exists();
-        assert exists || !expect : "attempted to delete non-existing file " + 
file.getName();
         try
         {
-            if (exists)
-                Files.delete(file.toPath());
+            Files.delete(file.toPath());
         }
         catch (Throwable t)
         {
@@ -210,7 +207,7 @@ public final class FileUtils
 
     public static void deleteWithConfirm(File file)
     {
-        maybeFail(deleteWithConfirm(file, true, null));
+        maybeFail(deleteWithConfirm(file, null));
     }
 
     public static void renameWithOutConfirm(String from, String to)


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

Reply via email to