Cassandra
  1. Cassandra
  2. CASSANDRA-4906

Avoid flushing other columnfamilies on truncate

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 3
    • Component/s: Core
    • 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
        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
        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
        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
        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
        Jonathan Ellis added a comment -

        v2 adds forceBlockingFlush to saveTruncatonPosition.

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

        +1

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

        Would it be possible to backport this to Cassandra 1.1?

        Show
        Chris Herron added a comment - Would it be possible to backport this to Cassandra 1.1?
        Hide
        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
        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
        Jonathan Ellis added a comment -

        (committed to 1.2.0.)

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development