You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksandr Sorokoumov (Jira)" <ji...@apache.org> on 2019/12/13 10:21:00 UTC

[jira] [Commented] (CASSANDRA-13917) COMPACT STORAGE queries on dense static tables accept hidden column1 and value columns

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

Aleksandr Sorokoumov commented on CASSANDRA-13917:
--------------------------------------------------

Thank you for your review [~ifesdjeen]!

As you suggested, I have slightly changed the approach. Now dense and sparse tables are considered separately. In case of dense tables we only need to add a compact value column if it has an empty type [1]. In case of sparse tables we also need to make sure that the table is not super in order not break thrift integration tests.

Branches:
* [13917-3.0|https://github.com/apache/cassandra/compare/cassandra-3.0...Gerrrr:13917-3.0]
* [13917-3.11|https://github.com/apache/cassandra/compare/cassandra-3.11...Gerrrr:13917-3.11]

CI results:
* [13917-3.0|https://jira.apache.org/jira/secure/attachment/12986317/13917-3.0-testall-13.12.2019.png]
* [13917-3.11|https://jira.apache.org/jira/secure/attachment/12986318/13917-3.11-testall-13.12.2019.png]

{{org.apache.cassandra.cql3.validation.operations.TTLTest.testCapWarnExpirationOverflowPolicy}} failure at the patch for 3.11 looked suspicious, but it did not reproduce locally on the same branch, so I believe that it is a CI glitch and not related to the patch.

1. Besides debugging on my own, I found this article on [Migrating from compact storage|https://docs.datastax.com/en/dse/5.1/cql/cql/cql_using/dropCompactStorage.html] that confirmed my assumptions about cases when {{column1}} and {{value}} columns are added, and when {{value}} type is empty.





> COMPACT STORAGE queries on dense static tables accept hidden column1 and value columns
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-13917
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13917
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core
>            Reporter: Alex Petrov
>            Assignee: Aleksandr Sorokoumov
>            Priority: Low
>              Labels: lhf
>             Fix For: 3.0.x, 3.11.x
>
>         Attachments: 13917-3.0-testall-13.12.2019, 13917-3.0-testall-2.png, 13917-3.0-testall-20.11.2019.png, 13917-3.0.png, 13917-3.11-testall-13.12.2019, 13917-3.11-testall-2.png, 13917-3.11-testall-20.11.2019.png, 13917-3.11.png
>
>
> Test for the issue:
> {code}
>     @Test
>     public void testCompactStorage() throws Throwable
>     {
>         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
>         assertInvalid("INSERT INTO %s (a, b, c, column1) VALUES (?, ?, ?, ?)", 1, 1, 1, ByteBufferUtil.bytes('a'));
>         // This one fails with Some clustering keys are missing: column1, which is still wrong
>         assertInvalid("INSERT INTO %s (a, b, c, value) VALUES (?, ?, ?, ?)", 1, 1, 1, ByteBufferUtil.bytes('a'));       
>         assertInvalid("INSERT INTO %s (a, b, c, column1, value) VALUES (?, ?, ?, ?, ?)", 1, 1, 1, ByteBufferUtil.bytes('a'), ByteBufferUtil.bytes('b'));
>         assertEmpty(execute("SELECT * FROM %s"));
>     }
> {code}
> Gladly, these writes are no-op, even though they succeed.
> {{value}} and {{column1}} should be completely hidden. Fixing this one should be as easy as just adding validations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org