cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Spriegel (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-5704) Truncate flushes to disk again in 1.2, even with durable_writes=false
Date Wed, 26 Jun 2013 13:40:20 GMT
Christian Spriegel created CASSANDRA-5704:

             Summary: Truncate flushes to disk again in 1.2, even with durable_writes=false
                 Key: CASSANDRA-5704
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.5
            Reporter: Christian Spriegel
            Assignee: Christian Spriegel
            Priority: Minor

I just upgraded my dev-environment to C* 1.2. Unfortunetaly 1.2 makes my JUnit tests slow
again, due to a blocking-flush in saveTruncationRecord().

With Cassandra 1.1 truncate was very fast due to: CASSANDRA-4153

My proposal is to make saveTruncationRecord() only flush when durableWrites are enabled.

My assumption is that if somebody turn off durable writes then he does not mind if truncate
is not guaranteed to be durable either.

I successfully tested the following patch with my testsuite. Its as fast as it was with 1.1
(maybe even faster!):
@@ -186,5 +186,8 @@ public class SystemTable
         String req = "UPDATE system.%s SET truncated_at = truncated_at + %s WHERE key = '%s'";
         processInternal(String.format(req, LOCAL_CF, truncationAsMapEntry(cfs, truncatedAt,
position), LOCAL_KEY));
-        forceBlockingFlush(LOCAL_CF);
+        KSMetaData ksm = Schema.instance.getKSMetaData(;
+        if (ksm.durableWrites) // flush only when durable_writes are enabled
+            forceBlockingFlush(LOCAL_CF);

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message