You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2015/07/23 15:38:04 UTC

[jira] [Commented] (CASSANDRA-9874) Compact value columns aren't being migrated properly in 3.0

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

Sylvain Lebresne commented on CASSANDRA-9874:
---------------------------------------------

lgtm, though as a very minor point, I'm not sure I would have continued in {{hasRegularColumns}} for the case where {{isEmptyCompactValueColumn(row)}}. In theory, if we have a compact value in the first place, we shouldn't have any regular and continuing the loop is fine, but I don't like that being implicit. Especially since, if something is weird in the schema (we have both an empty compact and some regular), whether we go through the upgrade or not would currently depends on the order of thing in {{columnRows}}. So I'd have either returned {{false}} directly for the empty compact case, so we're at least consistent in the face of brokenness, or make the loop validate we're not broken. Note: I probably wouldn't care too much for that kind of things normally, but we're doing a lot of stuff with the schema in this version, so being extra careful things are what we think they are doesn't feel wasted.

> Compact value columns aren't being migrated properly in 3.0
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-9874
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9874
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Aleksey Yeschenko
>            Assignee: Aleksey Yeschenko
>             Fix For: 3.0 beta 1
>
>
> To quote [Tyler|https://issues.apache.org/jira/browse/CASSANDRA-6717?focusedCommentId=14626965&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14626965]:
> 2.1 and 3.0 currently have different behavior around default compact value columns. When you create a table like this:
> {code}
> CREATE TABLE foo (
>     k int,
>     c int,
>     PRIMARY KEY (k, c)
> ) WITH COMPACT STORAGE;
> {code}
> 2.1 will add a {{compact_value}} column to {{system.schema_columns}} with an empty {{column_name}} and a {{BytesType}} validator.
> In 3.0, we instead add a {{regular}} column with the default compact value name ({{value}}) and an {{EmptyType}} validator.
> The logic in 3.0 depends on having an {{EmptyType}} column (see {{CompactTables.hasEmptyCompactValue()}}) but current trunk doesn't migrate the column. {{LegacySchemaMigrator.addDefinitionForUpgrade()}} almost does what we want, but doesn't add the {{EmptyType}} column because it sees the existing {{compact_value}} column.



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