Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-5704

add cassandra.unsafesystem property (Truncate flushes to disk again in 1.2, even with durable_writes=false)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.2.7, 2.0 beta 2
    • None
    • None
    • Low

    Description

      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(cfs.table.name);
      +        if (ksm.durableWrites) // flush only when durable_writes are enabled
      +            forceBlockingFlush(LOCAL_CF);
           }
      

      Attachments

        1. 5704_unsafeSystem.txt
          2 kB
          Christian Spriegel
        2. 5704-v2.txt
          0.7 kB
          Jonathan Ellis
        3. CASSANDRA_5704_V1_1_2.patch
          0.8 kB
          Christian Spriegel
        4. CASSANDRA_5704_V1_trunk.patch
          0.8 kB
          Christian Spriegel

        Issue Links

          Activity

            People

              jbellis Jonathan Ellis
              christianmovi Christian Spriegel
              Jonathan Ellis
              Brandon Williams
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: