Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92867D135 for ; Tue, 6 Nov 2012 00:34:14 +0000 (UTC) Received: (qmail 17135 invoked by uid 500); 6 Nov 2012 00:34:13 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 17108 invoked by uid 500); 6 Nov 2012 00:34:13 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 17099 invoked by uid 99); 6 Nov 2012 00:34:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 00:34:13 +0000 Date: Tue, 6 Nov 2012 00:34:13 +0000 (UTC) From: "Christian Spriegel (JIRA)" To: commits@cassandra.apache.org Message-ID: <1844809401.71646.1352162053857.JavaMail.jiratomcat@arcas> In-Reply-To: <1852473134.71484.1352160973427.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (CASSANDRA-4917) Optimize tombstone creation for ExpiringColumns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Spriegel updated CASSANDRA-4917: ------------------------------------------ Description: The goal of this ticket is to reduce the amount of tombstones created from ExpiringColumns. Currently tombstones will always stay a full gc_grace time, which is not neccessary for ExpiringColumns. We only need to ensure that ExpiringColumn and tombstone together live as long as gc_grace. If the ExpiringColumn's TTL>=gc_grace then we can create an already gcable tombstone and drop that instantly. My initial proposal was to use the ExpiringColumns creation-timestamp as deletiontime for the tombstone, but Sylvain pointed out that we should not mix local and client timestamps. So I changed it to this: {code} public static Column create(ByteBuffer name, ByteBuffer value, long timestamp, int timeToLive, int localExpirationTime, int expireBefore, IColumnSerializer.Flag flag) { if (localExpirationTime >= expireBefore || flag == IColumnSerializer.Flag.PRESERVE_SIZE) return new ExpiringColumn(name, value, timestamp, timeToLive, localExpirationTime); // the column is now expired, we can safely return a simple tombstone return new DeletedColumn(name, localExpirationTime-timeToLive, timestamp); // return new DeletedColumn(name, localExpirationTime, timestamp); // old code } {code} This was discussed on the mailinglist: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html was: The goal of this ticket is to reduce the amount of tombstones created from ExpiringColumns. Currently tombstones will always stay a full gc_grace time, which is not neccessary for ExpiringColumns. We only need to ensure that ExpiringColumn and tombstone together live as long as gc_grace. If the ExpiringColumn's TTL>=gc_grace then we can create an already gcable tombstone and drop that instantly. My initial proposal was to use the ExpiringColumns creation-timestamp as deletiontime for the tombstone, but Sylvain pointed out that we should not mix local and client timestamps. So I changed it to this: {code} public static Column create(ByteBuffer name, ByteBuffer value, long timestamp, int timeToLive, int localExpirationTime, int expireBefore, IColumnSerializer.Flag flag) { if (localExpirationTime >= expireBefore || flag == IColumnSerializer.Flag.PRESERVE_SIZE) return new ExpiringColumn(name, value, timestamp, timeToLive, localExpirationTime); // the column is now expired, we can safely return a simple tombstone return new DeletedColumn(name, *localExpirationTime-timeToLive*, timestamp); // return new DeletedColumn(name, localExpirationTime, timestamp); // old code } {code} This was discussed on the mailinglist: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html > Optimize tombstone creation for ExpiringColumns > ----------------------------------------------- > > Key: CASSANDRA-4917 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4917 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: Christian Spriegel > > The goal of this ticket is to reduce the amount of tombstones created from ExpiringColumns. > Currently tombstones will always stay a full gc_grace time, which is not neccessary for ExpiringColumns. We only need to ensure that ExpiringColumn and tombstone together live as long as gc_grace. If the ExpiringColumn's TTL>=gc_grace then we can create an already gcable tombstone and drop that instantly. > My initial proposal was to use the ExpiringColumns creation-timestamp as deletiontime for the tombstone, but Sylvain pointed out that we should not mix local and client timestamps. So I changed it to this: > {code} > public static Column create(ByteBuffer name, ByteBuffer value, long timestamp, int timeToLive, int localExpirationTime, int expireBefore, IColumnSerializer.Flag flag) > { > if (localExpirationTime >= expireBefore || flag == IColumnSerializer.Flag.PRESERVE_SIZE) > return new ExpiringColumn(name, value, timestamp, timeToLive, localExpirationTime); > // the column is now expired, we can safely return a simple tombstone > return new DeletedColumn(name, localExpirationTime-timeToLive, timestamp); > // return new DeletedColumn(name, localExpirationTime, timestamp); // old code > } > {code} > This was discussed on the mailinglist: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html -- 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: http://www.atlassian.com/software/jira