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 6D2BE1024D for ; Tue, 9 Dec 2014 18:49:13 +0000 (UTC) Received: (qmail 80775 invoked by uid 500); 9 Dec 2014 18:49:12 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 80656 invoked by uid 500); 9 Dec 2014 18:49:12 -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 80375 invoked by uid 99); 9 Dec 2014 18:49:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2014 18:49:12 +0000 Date: Tue, 9 Dec 2014 18:49:12 +0000 (UTC) From: "Alan Boudreault (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8430) Updating a row that has a TTL produce unexpected results 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-8430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14239826#comment-14239826 ] Alan Boudreault commented on CASSANDRA-8430: -------------------------------------------- [~angarrett] I think your confusion is due to the the fact that you consider the *PRIMARY KEY* as a column, when it is not. The TTL of the Primary Key (or row) is MAX(all_column_ttls), 0 being considered as infinity, so the higher. So it is normal that modifying a column ttl with a lower ttl doesn't affect the row TTL. Does it make sense? [~slebresne] can confirm if I'm right too. > Updating a row that has a TTL produce unexpected results > -------------------------------------------------------- > > Key: CASSANDRA-8430 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8430 > Project: Cassandra > Issue Type: Bug > Reporter: Alan Boudreault > Labels: cassandra, ttl > Fix For: 2.0.11, 2.1.2, 3.0 > > Attachments: test.sh > > > Reported on stackoverflow: http://stackoverflow.com/questions/27280407/cassandra-ttl-gets-set-to-0-on-primary-key-if-no-ttl-is-specified-on-an-update?newreg=19e8c6757c62474985fef7c3037e8c08 > I can reproduce the issue with 2.0, 2.1 and trunk. I've attached a small script to reproduce the issue with CCM, and here is it's output: > {code} > aboudreault@kovarro:~/dev/cstar/so27280407$ ./test.sh > Current cluster is now: local > Insert data with a 5 sec TTL > INSERT INTO ks.tbl (pk, foo, bar) values (1, 1, 'test') using TTL 5; > pk | bar | foo > ----+------+----- > 1 | test | 1 > (1 rows) > Update data with no TTL > UPDATE ks.tbl set bar='change' where pk=1; > sleep 6 sec > BUG: Row should be deleted now, but isn't. and foo column has been deleted??? > pk | bar | foo > ----+--------+------ > 1 | change | null > (1 rows) > Insert data with a 5 sec TTL > INSERT INTO ks.tbl (pk, foo, bar) values (1, 1, 'test') using TTL 5; > pk | bar | foo > ----+------+----- > 1 | test | 1 > (1 rows) > Update data with a higher (10) TTL > UPDATE ks.tbl USING TTL 10 set bar='change' where pk=1; > sleep 6 sec > BUG: foo column has been deleted? > pk | bar | foo > ----+--------+------ > 1 | change | null > (1 rows) > sleep 5 sec > Data is deleted now after the second TTL set during the update. Is this a bug or the expected behavior? > (0 rows) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)