From 053cfd9d138359d26e911417c7f8c7e60ce2dcad Mon Sep 17 00:00:00 2001 From: Nimai Agarwal <47481810+nimai-agarwal@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:26:15 -0400 Subject: [PATCH] Add logging around cassandra snapshot and flushing (#480) Co-authored-by: Nimai Agarwal --- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 ++ src/java/org/apache/cassandra/db/Keyspace.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java index 6c4eea84fe..88931aea4a 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java +++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java @@ -1112,6 +1112,7 @@ public ReplayPosition call() public ReplayPosition forceBlockingFlush(String reason) { + logger.debug("Flushing memtables on cf {} due to {}", name, reason); return FBUtilities.waitOnFuture(forceFlush(reason)); } @@ -2663,6 +2664,7 @@ public void snapshotWithoutFlush(String snapshotName) */ public Set snapshotWithoutFlush(String snapshotName, Predicate predicate, boolean ephemeral) { + logger.debug("Taking snapshot without flush for {}", name); Set snapshottedSSTables = new HashSet<>(); final JSONArray filesJSONArr = new JSONArray(); for (ColumnFamilyStore cfs : concatWithIndexes()) diff --git a/src/java/org/apache/cassandra/db/Keyspace.java b/src/java/org/apache/cassandra/db/Keyspace.java index c4da8574fd..bfdc3de02a 100644 --- a/src/java/org/apache/cassandra/db/Keyspace.java +++ b/src/java/org/apache/cassandra/db/Keyspace.java @@ -217,8 +217,10 @@ public void snapshot(String snapshotName, String columnFamilyName, boolean ephem { if (columnFamilyName == null || cfStore.name.equals(columnFamilyName)) { + logger.debug("Attempting snapshot with snapshotName {} of cf {}", snapshotName, columnFamilyName); tookSnapShot = true; cfStore.snapshot(snapshotName, null, ephemeral); + logger.debug("Finished snapshot with snapshotName {} of cf {}", snapshotName, columnFamilyName); } }