cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ZhaoYang (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-13409) Materialized Views: View cells are resurrected
Date Sun, 07 May 2017 06:29:05 GMT

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

ZhaoYang edited comment on CASSANDRA-13409 at 5/7/17 6:28 AM:
--------------------------------------------------------------

|| source || junit || dtest||
| [3.0|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13409-3.0]| [utest|https://circleci.com/gh/jasonstack/cassandra/42]
| |
| [3.11|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13409-3.11] | [utest|https://circleci.com/gh/jasonstack/cassandra/46?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link]
| |
| [dtest|https://github.com/jasonstack/cassandra-dtest/commits/CASSANDRA-13409] | | |


1. if there is row deletion on base, now it will create regular-row-tombstone for view.  (previously
only shadowable-row-tombstones)

2. modify Row.Deletion to retain one more regular-row-tombtone with extra flag in UnfilteredSerializer
    * the most recent regular-row-tombstone which has TS < most recent shadowable-row-tombstones's
TS
    * if shadowable-row-tombstone is shadowed by new row, its retained regular-row-tombstone(could
be LIVE) will be used

3. changed sstabledump (aka sstableexport) to support : shadowable/regular row.deletion as
following:
   {code}
   "rows" : [
      {
        "type" : "row",
        "position" : 63,
        "clustering" : [ "3" ],
        "deletion_info" : {
          "shadowable" : { "marked_deleted" : "1970-01-01T00:00:00.000004Z", "local_delete_time"
: "2017-05-06T03:21:47Z" },
          "regular" : { "marked_deleted" : "1970-01-01T00:00:00.000002Z", "local_delete_time"
: "2017-05-06T03:21:47Z" }
        },
        "cells" : [ ]
      }
    ]
   {code}


was (Author: jasonstack):
|| source || junit || dtest||
| [3.0|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13409-3.0]| [utest|https://circleci.com/gh/jasonstack/cassandra/42]
| |
| [3.11|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13409-3.11] | | |
| [dtest|https://github.com/jasonstack/cassandra-dtest/commits/CASSANDRA-13409] | | |


1. if there is row deletion on base, now it will create regular-row-tombstone for view.  (previously
only shadowable-row-tombstones)

2. modify Row.Deletion to retain one more regular-row-tombtone with extra flag in UnfilteredSerializer
    * the most recent regular-row-tombstone which has TS < most recent shadowable-row-tombstones's
TS
    * if shadowable-row-tombstone is shadowed by new row, its retained regular-row-tombstone(could
be LIVE) will be used

3. changed sstabledump (aka sstableexport) to support : shadowable/regular row.deletion as
following:
   {code}
   "rows" : [
      {
        "type" : "row",
        "position" : 63,
        "clustering" : [ "3" ],
        "deletion_info" : {
          "shadowable" : { "marked_deleted" : "1970-01-01T00:00:00.000004Z", "local_delete_time"
: "2017-05-06T03:21:47Z" },
          "regular" : { "marked_deleted" : "1970-01-01T00:00:00.000002Z", "local_delete_time"
: "2017-05-06T03:21:47Z" }
        },
        "cells" : [ ]
      }
    ]
   {code}

> 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


Mime
View raw message