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

Aleksandr Sorokoumov updated CASSANDRA-10968:
---------------------------------------------
         Reviewer: Alex Petrov
    Fix Version/s: 2.1.12
    Reproduced In: 2.2.4, 2.1.12  (was: 2.1.12, 2.2.4)
           Status: Patch Available  (was: Open)

I was able to reproduce the behavior described in 
http://www.mail-archive.com/user%40cassandra.apache.org/msg42019.html by 
creating a snapshot on a table with 2 columns and a secondary index:

{CODE}
CREATE KEYSPACE X
  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

USE X;

CREATE TABLE table1 (
  col1 varchar,
  col2 varchar,
  PRIMARY KEY (col1, col2)
);
CREATE INDEX col2_idx ON X.table1 (col2);

INSERT INTO x.table1 (col1, col2) VALUES ('a1', 'a2');
INSERT INTO x.table1 (col1, col2) VALUES ('b1', 'b2');
{CODE}

Before the patch, branch cassandra-2.1.12:
{CODE}
$ bin/nodetool snapshot x
Requested creating snapshot(s) for [x] with snapshot name [1491658291872]
Snapshot directory: 1491658291872

$ cat 
data/data/x/table1-a47092a01aa011e7b2e959ff5fdd622a/snapshots/1491658291872/manifest.json
{"files":["x-table1.col2_idx-ka-1-Data.db"]}
{CODE}

In the manifest above the index table is missing.

After the patch:
{CODE}
$ git checkout 10968-2.1.12
previous HEAD position was a6619e56b1... bump 2.1 versions
Switched to branch '10968-2.1.12'

$ bin/nodetool snapshot x
Requested creating snapshot(s) for [x] with snapshot name [1491658830545]
Snapshot directory: 1491658830545

$ cat 
data/data/x/table1-a47092a01aa011e7b2e959ff5fdd622a/snapshots/1491658830545/manifest.json
{"files":["x-table1-ka-1-Data.db","x-table1.col2_idx-ka-1-Data.db"]}
{CODE}

*Link to the branch* https://github.com/Gerrrr/cassandra/tree/10968-2.1.12

> When taking snapshot, manifest.json contains incorrect or no files when 
> column family has secondary indexes
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10968
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10968
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Fred A
>            Assignee: Aleksandr Sorokoumov
>              Labels: lhf
>             Fix For: 2.1.12
>
>
> xNoticed indeterminate behaviour when taking snapshot on column families that 
> has secondary indexes setup. The created manifest.json created when doing 
> snapshot, sometimes contains no file names at all and sometimes some file 
> names. 
> I don't know if this post is related but that was the only thing I could find:
> http://www.mail-archive.com/user%40cassandra.apache.org/msg42019.html



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to