You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benedict (JIRA)" <ji...@apache.org> on 2014/04/22 20:44:14 UTC

[jira] [Comment Edited] (CASSANDRA-7066) Simplify (and unify) cleanup of compaction leftovers

    [ https://issues.apache.org/jira/browse/CASSANDRA-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977174#comment-13977174 ] 

Benedict edited comment on CASSANDRA-7066 at 4/22/14 6:42 PM:
--------------------------------------------------------------

So we already have it, the problem is we don't want to keep it resident? What's the problem with just reading it on startup for cleaning up compaction left overs?

For cleaning up compaction all we need is direct ancestors, but it's not really a problem to read all ancestors and filter based on those files we know exist to avoid unnecessary heap pressure. Seems much more robust and simple to reason about to me...?

If we only have direct ancestors, we wouldn't be permitted to delete any sstable that shadows another that isn't itself already deleted (which can be delayed for a period)... but this still gives us better behaviour than the current setup. This could be achieved with an OpOrder reasonably easily, or simply rescheduling the DeletingTask if any of its ancestors are still alive.

Right now, we can "finish compaction" with the replacement sstable finished and ready to read, but the replaced/expired sstables untidied. If something happens at this point, we end up with all of the tables.


was (Author: benedict):
So we already have it, the problem is we don't want to keep it resident? What's the problem with just reading it on startup for cleaning up compaction left overs?

For cleaning up compaction all we need is direct ancestors, but it's not really a problem to read all ancestors and filter based on those files we know exist to avoid unnecessary heap pressure. Seems much more robust and simple to reason about to me...?

> Simplify (and unify) cleanup of compaction leftovers
> ----------------------------------------------------
>
>                 Key: CASSANDRA-7066
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7066
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Priority: Minor
>             Fix For: 3.0
>
>
> Currently we manage a list of in-progress compactions in a system table, which we use to cleanup incomplete compactions when we're done. The problem with this is that 1) it's a bit clunky (and leaves us in positions where we can unnecessarily cleanup completed files, or conversely not cleanup files that have been superceded); and 2) it's only used for a regular compaction - no other compaction types are guarded in the same way, so can result in duplication if we fail before deleting the replacements.
> I'd like to see each sstable store in its metadata its direct ancestors, and on startup we simply delete any sstables that occur in the union of all ancestor sets. This way as soon as we finish writing we're capable of cleaning up any leftovers, so we never get duplication. It's also much easier to reason about.



--
This message was sent by Atlassian JIRA
(v6.2#6252)