[ 
https://issues.apache.org/jira/browse/CASSANDRA-13917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-13917:
-----------------------------------------
    Status: Open  (was: Resolved)

Re-opening because this patch breaks things badly. Did you run the tests after 
the move of {{isHiddenColumn}} to {{getColumnDefinition}}? Because if so, our 
tests aren't very good.

The committed version, that move {{isHiddenColumn}} to {{getColumnDefinition}}, 
means the compact column is invisible internally, which is wrong, it must be 
accessible internally.

Concretely, a simple test that creates a 2ndary index, wait for it to be built, 
and then restart the node will fail on restart with
{noformat}
java.lang.RuntimeException: Unknown column value during deserialization
        at 
org.apache.cassandra.db.SerializationHeader$Component.toHeader(SerializationHeader.java:353)
 ~[main/:na]
        at 
org.apache.cassandra.io.sstable.format.SSTableReader.open(SSTableReader.java:496)
 ~[main/:na]
        at 
org.apache.cassandra.io.sstable.format.SSTableReader.open(SSTableReader.java:365)
 ~[main/:na]
        at 
org.apache.cassandra.io.sstable.format.SSTableReader$2.run(SSTableReader.java:544)
 ~[main/:na]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_152]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[na:1.8.0_152]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[na:1.8.0_152]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[na:1.8.0_152]
        at 
org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:83)
 [main/:na]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]
{noformat}
because the {{SystemKeyspace.BUILT_INDEXES}} table is compact, so when it tries 
to open the header of the sstables for this table, the {{getColumnDefinition}} 
returns {{null}} for the {{value}} column, even though it obviously exists and 
should be returned.


> 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-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to