Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8BE2A200C78 for ; Thu, 4 May 2017 06:53:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A88D160BBA; Thu, 4 May 2017 04:53:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D1888160BB5 for ; Thu, 4 May 2017 06:53:10 +0200 (CEST) Received: (qmail 28302 invoked by uid 500); 4 May 2017 04:53:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 28286 invoked by uid 99); 4 May 2017 04:53:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2017 04:53:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 588E6C86A9 for ; Thu, 4 May 2017 04:53:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qCqNoDiyVG8W for ; Thu, 4 May 2017 04:53:08 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id D0E8B5FE3D for ; Thu, 4 May 2017 04:53:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C349EE0A2F for ; Thu, 4 May 2017 04:53:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7B08721DEE for ; Thu, 4 May 2017 04:53:04 +0000 (UTC) Date: Thu, 4 May 2017 04:53:04 +0000 (UTC) From: "ZhaoYang (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-13409) Materialized Views: View cells are resurrected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 04 May 2017 04:53:11 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994766#comment-15994766 ] ZhaoYang edited comment on CASSANDRA-13409 at 5/4/17 4:52 AM: -------------------------------------------------------------- Thanks. I didn't think about compaction with sub-group deleted cell + shadowable row tombstone: deleted cells should be kept even if there is more recent shadowable row-tombstones, this could be done without changing storage format regular row tombstone + shadowable row tombstone: if shadowable is newer, only most recent regular row tombstone plus shadowable should be kept. maybe have to change storage format. eg. extra flag to indicate extra deletion. was (Author: jasonstack): Thanks. deleted cell + shadowable row tombstone: deleted cells should be kept even if there is more recent shadowable row-tombstones, this could be done without changing storage format regular row tombstone + shadowable row tombstone: if shadowable is newer, only most recent regular row tombstone plus shadowable should be kept. maybe have to change storage format. eg. extra flag to indicate extra deletion. > Materialized Views: View cells are resurrected > ---------------------------------------------- > > Key: CASSANDRA-13409 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13409 > Project: Cassandra > Issue Type: Bug > Components: Local Write-Read Paths, Materialized Views > Reporter: Duarte Nunes > Assignee: ZhaoYang > > Consider the following commands, ran against trunk@0f054fee5c: > {code:xml} > echo "create keyspace ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};" | bin/cqlsh > echo "create table ks.base (p int primary key, v1 int, v2 int) with gc_grace_seconds = 1;" | bin/cqlsh > echo "create materialized view ks.my_view as select * from ks.base where p is not null and v1 is not null primary key (v1, p);" | bin/cqlsh > echo "insert into ks.base (p, v1, v2) values (3, 1, 3) using timestamp 1;" | bin/cqlsh > bin/nodetool flush ks my_view base > echo "delete from ks.base using timestamp 2 where p = 3;" | bin/cqlsh > bin/nodetool flush ks my_view base > echo "insert into ks.base (p, v1) values (3, 1) using timestamp 3;" | bin/cqlsh > bin/nodetool flush ks my_view base > echo "select * from ks.my_view;" | bin/cqlsh > v1 | p | v2 > ----+---+---- > 1 | 3 | 3 > (1 rows) > echo "select * from ks.base;" | bin/cqlsh > p | v1 | v2 > ---+----+------ > 3 | 1 | null > (1 rows) > {code} > As you can see, this incorrectly brings back cell v2=3. > There is one definitive problem and a potential one: > * Merging rows must be commutative. If a shadowable tombstone is applied after a row tombstone, it will replace that tombstone; if a row marker shadows the shadowable tombstone before the row containing the original data is applied, then any dead cells in said data will be resurrected; > * Shadowable tombstones shouldn't compact away previous row tombstones or even deleted cells; if the relevant tombstones have been GCed from the base table, then a base table update won't carry them anymore (alongside a newer row marker). -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org