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

Avoid flushing other columnfamilies on truncate

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 3
    • Component/s: None
    • Labels:
      None

      Description

      Currently truncate flushes all columnfamilies so it can get rid of the commitlog segments containing truncated data. Otherwise, it could be replayed on restart since the replay position is contained in the sstables we're trying to delete.

      1. 4906.txt
        16 kB
        Jonathan Ellis
      2. 4906-v2.txt
        16 kB
        Jonathan Ellis

        Activity

        Hide
        jbellis Jonathan Ellis added a comment -

        Patch attached to save truncate position in system.local instead. (This should be safe since we already open all Table + CFS before CL replay.)

        Show
        jbellis Jonathan Ellis added a comment - Patch attached to save truncate position in system.local instead. (This should be safe since we already open all Table + CFS before CL replay.)
        Hide
        yukim Yuki Morishita added a comment -

        I'm seeing truncated data appear again after commit log replay.
        Looks like we have to flush system.local after truncate, otherwise we are not able to query 'truncated_at' properly before commit log replays update of truncated_at.

        Show
        yukim Yuki Morishita added a comment - I'm seeing truncated data appear again after commit log replay. Looks like we have to flush system.local after truncate, otherwise we are not able to query 'truncated_at' properly before commit log replays update of truncated_at.
        Hide
        jbellis Jonathan Ellis added a comment -

        v2 adds forceBlockingFlush to saveTruncatonPosition.

        Show
        jbellis Jonathan Ellis added a comment - v2 adds forceBlockingFlush to saveTruncatonPosition.
        Hide
        yukim Yuki Morishita added a comment -

        +1

        Show
        yukim Yuki Morishita added a comment - +1
        Hide
        cherro Chris Herron added a comment -

        Would it be possible to backport this to Cassandra 1.1?

        Show
        cherro Chris Herron added a comment - Would it be possible to backport this to Cassandra 1.1?
        Hide
        jbellis Jonathan Ellis added a comment -

        Yes, backporting is probably straightforward. But we shouldn't risk 1.1 stability with a new approach at this point.

        Show
        jbellis Jonathan Ellis added a comment - Yes, backporting is probably straightforward. But we shouldn't risk 1.1 stability with a new approach at this point.
        Hide
        jbellis Jonathan Ellis added a comment -

        (committed to 1.2.0.)

        Show
        jbellis Jonathan Ellis added a comment - (committed to 1.2.0.)

          People

          • Assignee:
            jbellis Jonathan Ellis
            Reporter:
            jbellis Jonathan Ellis
            Reviewer:
            Yuki Morishita
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development