You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alex Petrov (JIRA)" <ji...@apache.org> on 2018/11/12 09:43:00 UTC

[jira] [Comment Edited] (CASSANDRA-13917) COMPACT STORAGE inserts on tables without clusterings accept hidden column1 and value columns

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

Alex Petrov edited comment on CASSANDRA-13917 at 11/12/18 9:42 AM:
-------------------------------------------------------------------

The patch looks good, modulo indentation in tests. Also, I would list all unmatching columns in the error message instead of just a single in case someone would try to repair query by repairing one column after another.

Another thing, to my best memory, we have actual definitions listed [here|https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/config/CFMetaData.java#L138], which we probably should use. I realise that this does not change much semantically but still might be less error-prone.

Lastly, it'd be great to rebase both patches.


was (Author: ifesdjeen):
The patch looks good, modulo indentation in tests. Also, I would list all unmatching columns in the error message instead of just a single in case someone would try to repair query by repairing one column after another.

Another thing, to my best memory, we have actual definitions listed [here|https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/config/CFMetaData.java#L138], which we probably should use. I realise that this does not change much semantically but still might be less error-prone.

> COMPACT STORAGE inserts on tables without clusterings accept hidden column1 and value columns
> ---------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-13917
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13917
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Alex Petrov
>            Assignee: Aleksandr Sorokoumov
>            Priority: Minor
>              Labels: lhf
>             Fix For: 3.0.x, 3.11.x
>
>
> 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
(v7.6.3#76005)

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