This is an automated email from the ASF dual-hosted git repository.
brandonwilliams 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 e99a8da Don't clean when enabling FQL via JMX
e99a8da is described below
commit e99a8da161ed599c1a22a853c9c7f9caf6c1eb79
Author: Brandon Williams <[email protected]>
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 7e460b6..d60f541 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -65,6 +65,7 @@
* Add a system property to set hostId if not yet initialized (CASSANDRA-14582)
* GossiperTest.testHasVersion3Nodes didn't take into account trunk version
changes, fixed to rely on latest version (CASSANDRA-16651)
Merged from 4.0:
+ * 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 ba88127..a3c9c1a 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 44d757b..8fde79b 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -6081,7 +6081,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: [email protected]
For additional commands, e-mail: [email protected]