Skip to content

Commit

Permalink
Add logging around cassandra snapshot and flushing (#480)
Browse files Browse the repository at this point in the history
Co-authored-by: Nimai Agarwal <[email protected]>
  • Loading branch information
nimai-agarwal and Nimai Agarwal authored Apr 5, 2024
1 parent eab6db4 commit 053cfd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -2663,6 +2664,7 @@ public void snapshotWithoutFlush(String snapshotName)
*/
public Set<SSTableReader> snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral)
{
logger.debug("Taking snapshot without flush for {}", name);
Set<SSTableReader> snapshottedSSTables = new HashSet<>();
final JSONArray filesJSONArr = new JSONArray();
for (ColumnFamilyStore cfs : concatWithIndexes())
Expand Down
2 changes: 2 additions & 0 deletions src/java/org/apache/cassandra/db/Keyspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 053cfd9

Please sign in to comment.