You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "ZhaoYang (JIRA)" <ji...@apache.org> on 2017/09/18 12:42:00 UTC
[jira] [Created] (CASSANDRA-13883) StrictLiveness for view row is
not handled in DataLimits
ZhaoYang created CASSANDRA-13883:
------------------------------------
Summary: StrictLiveness for view row is not handled in DataLimits
Key: CASSANDRA-13883
URL: https://issues.apache.org/jira/browse/CASSANDRA-13883
Project: Cassandra
Issue Type: Bug
Components: Materialized Views
Reporter: ZhaoYang
Assignee: ZhaoYang
In {{AbstractRow.hasLiveData(nowInSecond)}}, it doesn't handle {{strictLiveness}} introduced in CASSANDRA-11500. The {{DataLimits}} counts the expired view row as live data and then the expired view row is purged in {{Row.purge()}}. When query with limit, we will get less data.
{code:title=test to reproduce}
@Test
public void testRegularColumnTimestampUpdates() throws Throwable
{
createTable("CREATE TABLE %s (" +
"k int PRIMARY KEY, " +
"c int, " +
"val int)");
execute("USE " + keyspace());
executeNet(protocolVersion, "USE " + keyspace());
createView("mv_rctstest", "CREATE MATERIALIZED VIEW %s AS SELECT * FROM %%s WHERE k IS NOT NULL AND c IS NOT NULL PRIMARY KEY (k,c)");
updateView("UPDATE %s SET c = ?, val = ? WHERE k = ?", 0, 0, 0);
updateView("UPDATE %s SET val = ? WHERE k = ?", 1, 0);
updateView("UPDATE %s SET c = ? WHERE k = ?", 1, 0);
assertRows(execute("SELECT c, k, val FROM mv_rctstest"), row(1, 0, 1));
updateView("TRUNCATE %s");
updateView("UPDATE %s USING TIMESTAMP 1 SET c = ?, val = ? WHERE k = ?", 0, 0, 0);
updateView("UPDATE %s USING TIMESTAMP 3 SET c = ? WHERE k = ?", 1, 0);
updateView("UPDATE %s USING TIMESTAMP 2 SET val = ? WHERE k = ?", 1, 0);
updateView("UPDATE %s USING TIMESTAMP 4 SET c = ? WHERE k = ?", 2, 0);
updateView("UPDATE %s USING TIMESTAMP 3 SET val = ? WHERE k = ?", 2, 0);
// FIXME no rows return
assertRows(execute("SELECT c, k, val FROM mv_rctstest limit 1"), row(2, 0, 2));
assertRows(execute("SELECT c, k, val FROM mv_rctstest"), row(2, 0, 2));
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org