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

brandonwilliams pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
     new aa82e3e  Don't clean when enabling FQL via JMX
aa82e3e is described below

commit aa82e3e4277397dbf630c7b805c5aaca22d660ad
Author: Brandon Williams <brandonwilli...@apache.org>
AuthorDate: Thu Nov 18 10:58:53 2021 -0600

    Don't clean when enabling FQL via JMX
    
    Patch by brandonwilliams; reviewed by bereng for CASSANDRA-17136
---
 CHANGES.txt                                              |  1 +
 src/java/org/apache/cassandra/fql/FullQueryLogger.java   | 16 ++++++++++++++++
 .../org/apache/cassandra/service/StorageService.java     |  2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 055a46e..77d2737 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.2
+ * Fix disk failure triggered when enabling FQL on an unclean directory 
(CASSANDRA-17136)
  * Fixed broken classpath when multiple jars in build directory 
(CASSANDRA-17129)
  * DebuggableThreadPoolExecutor does not propagate client warnings 
(CASSANDRA-17072)
  * internode_send_buff_size_in_bytes and internode_recv_buff_size_in_bytes 
have new names. Backward compatibility with the old names added 
(CASSANDRA-17141)
diff --git a/src/java/org/apache/cassandra/fql/FullQueryLogger.java 
b/src/java/org/apache/cassandra/fql/FullQueryLogger.java
index 9725cea..cb35fcf 100644
--- a/src/java/org/apache/cassandra/fql/FullQueryLogger.java
+++ b/src/java/org/apache/cassandra/fql/FullQueryLogger.java
@@ -107,6 +107,22 @@ public class FullQueryLogger implements 
QueryEvents.Listener
         QueryEvents.instance.registerListener(this);
     }
 
+    public synchronized void enableWithoutClean(Path path, String rollCycle, 
boolean blocking, int maxQueueWeight, long maxLogSize, String archiveCommand, 
int maxArchiveRetries)
+    {
+        if (this.binLog != null)
+            throw new IllegalStateException("Binlog is already configured");
+        this.binLog = new BinLog.Builder().path(path)
+                                          .rollCycle(rollCycle)
+                                          .blocking(blocking)
+                                          .maxQueueWeight(maxQueueWeight)
+                                          .maxLogSize(maxLogSize)
+                                          .archiveCommand(archiveCommand)
+                                          .maxArchiveRetries(maxArchiveRetries)
+                                          .build(false);
+        QueryEvents.instance.registerListener(this);
+    }
+
+
     static
     {
         ByteBuf buf = CBUtil.allocator.buffer(0, 0);
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 3c94568..d78e0e8 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -5926,7 +5926,7 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
         maxArchiveRetries = maxArchiveRetries != Integer.MIN_VALUE ? 
maxArchiveRetries : fqlOptions.max_archive_retries;
 
         Preconditions.checkNotNull(path, "cassandra.yaml did not set log_dir 
and not set as parameter");
-        FullQueryLogger.instance.enable(Paths.get(path), rollCycle, blocking, 
maxQueueWeight, maxLogSize, archiveCommand, maxArchiveRetries);
+        FullQueryLogger.instance.enableWithoutClean(Paths.get(path), 
rollCycle, blocking, maxQueueWeight, maxLogSize, archiveCommand, 
maxArchiveRetries);
     }
 
     @Override

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

Reply via email to