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

Sylvain Lebresne commented on CASSANDRA-12423:
----------------------------------------------

I'm not sure about the solution of this patch. First, I'm bothered with 
"polluting" the storage engine just for this; I fear we'll have to drag that on 
for a long time if we do so and that's annoying. Second, I think this imply 
really complex upgrade instructions and not a very good user experience.

And I believe there is a simpler fix.

The problem is when a end bound is composite, has only a prefix of all the 
components and the EOC is 0. In that case, it means the tombstone (or slice) 
goes up to the prefix, including it, but not further. In other words, anything 
with that prefix but other component is excluded. We can get that easily by 
making an exlusive end until the prefix *plus* a empty component after it.

To take an example, say I use the syntax {{<x><y>\[0\]}} to denote a 2 
component composite with a 0 EOC. The end range tombstone of Tomasz above is 
{{<'asd'>\[0\]}}, but it would be equivalent to use {{<'asd'><>\[-1\]}} instead 
(that is, adding an empty component as 2nd component instead of not having one 
at all, but excluding that exact "full" clustering). It's equivalent because 
{{<'asd'><>}} is the very next item ordering after {{<'asd'>}}, and so going up 
until the latter one inclusive is the same than going up to the former 
exclusive.

And we can easily represent that {{<'asd'><>\[-1\]}} composite in 3.0 (it just 
uses {{EXCL_END_BOUND}}), so I think that's what we should return from 
{{LegacyLayout.decodeBound()}} in that case.

> Cells missing from compact storage table after upgrading from 2.1.9 to 3.7
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-12423
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12423
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Tomasz Grabiec
>            Assignee: Stefania
>         Attachments: 12423.tar.gz
>
>
> Schema:
> {code}
> create table ks1.test ( id int, c1 text, c2 text, v int, primary key (id, c1, 
> c2)) with compact storage and compression = {'sstable_compression': ''};
> {code}
> sstable2json before upgrading:
> {code}
> [
> {"key": "1",
>  "cells": [["","0",1470761440040513],
>            ["a","asd",2470761440040513,"t",1470764842],
>            ["asd:","0",1470761451368658],
>            ["asd:asd","0",1470761449416613]]}
> ]
> {code}
> Query result with 2.1.9:
> {code}
> cqlsh> select * from ks1.test;
>  id | c1  | c2   | v
> ----+-----+------+---
>   1 |     | null | 0
>   1 | asd |      | 0
>   1 | asd |  asd | 0
> (3 rows)
> {code}
> Query result with 3.7:
> {code}
> cqlsh> select * from ks1.test;
>  id | 6331 | 6332 | v
> ----+------+------+---
>   1 |      | null | 0
> (1 rows)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to