You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksandr Sorokoumov (JIRA)" <ji...@apache.org> on 2017/04/10 20:18:41 UTC

[jira] [Comment Edited] (CASSANDRA-10968) When taking snapshot, manifest.json contains incorrect or no files when column family has secondary indexes

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

Aleksandr Sorokoumov edited comment on CASSANDRA-10968 at 4/10/17 8:17 PM:
---------------------------------------------------------------------------

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}

*Links to the branches:*

* https://github.com/Gerrrr/cassandra/tree/10968-2.1.12
* https://github.com/Gerrrr/cassandra/tree/10968-2.2.4


was (Author: gerrrr):
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)