[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-24 Thread Sam Tunnicliffe (JIRA)

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

Sam Tunnicliffe commented on CASSANDRA-5614:


I realised I'd missed the case where columns are added after a RT, so attaching 
a fourth patch which handles that. 
My github branch is https://github.com/beobal/cassandra/tree/5614


> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
> Attachments: 
> 0001-CASSANDRA-5614-PreCompactedRow-updates-2i-correctly.patch, 
> 0002-CASSANDRA-5614-LazilyCompactedRow-outputs-SSTables-a.patch, 
> 0003-CASSANDRA-5614-Memtable-updates-with-RowTombstone-up.patch, 
> 0004-CASSANDRA-5614-Consider-timestamps-when-checking-col.patch
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-23 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5614:
---

Thanks! Do you have a github branch for this?

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
> Attachments: 
> 0001-CASSANDRA-5614-PreCompactedRow-updates-2i-correctly.patch, 
> 0002-CASSANDRA-5614-LazilyCompactedRow-outputs-SSTables-a.patch, 
> 0003-CASSANDRA-5614-Memtable-updates-with-RowTombstone-up.patch
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-23 Thread Sam Tunnicliffe (JIRA)

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

Sam Tunnicliffe commented on CASSANDRA-5614:


First, we aren't doing the right thing in compaction either. Neither PCR or LCR 
clean up the index in the face of range tombstones, relying on repairs at read 
time to purge obsolete entries.
Looking into this, it also seems that PCR & LCR actually generate different 
SSTables. Although they're functionally equivalent, those that come from PCR 
don't have any columns covered by a RangeTombstone. SSTables generated by LCR 
do contain these redundant extra columns.

eg: if we have two SSTables:
{code}
[{"key": "6e697276616e61","columns": 
[
["bleach:","",1374246211348000], 
["bleach:rating","4",1374246211348000], 
["bleach:release","1",1374246211348000], 
["nevermind:","",1374246211365000], 
["nevermind:rating","5",1374246211365000], 
["nevermind:release","2",1374246211365000]
]
}]

[{"key": "6e697276616e61","columns": 
[
["nevermind","nevermind:!",1374246212053000,"t",1374246212]
]
}]
{code}

When compacted with PCR we end up with in :
{code}
[{
"key": "6e697276616e61",
"columns": [
["bleach:","",1374246658577000], 
["bleach:rating","4",1374246658577000], 
["bleach:release","1",1374246658577000], 
["nevermind","nevermind:!",1374246659274000,"t",1374246659]
]
}]
{code}

But with LCR we get:
{code}
[{
"key": "6e697276616e61",
"columns": [
["bleach:","",1374246211348000], 
["bleach:rating","4",1374246211348000], 
["bleach:release","1",1374246211348000], 
["nevermind","nevermind:!",1374246212053000,"t",1374246212], 
["nevermind:","",1374246211365000], 
["nevermind:rating","5",1374246211365000], 
["nevermind:release","2",1374246211365000]
]
}]
{code}

The first patch fixes PCR to clean up indexes properly.  
The second fixes LCR so that it generates SSTables like PCR & fixes its index 
cleanup. 
The third adds the index cleanup for memtable updates with RT.

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
> Attachments: 
> 0001-CASSANDRA-5614-PreCompactedRow-updates-2i-correctly.patch, 
> 0002-CASSANDRA-5614-LazilyCompactedRow-outputs-SSTables-a.patch, 
> 0003-CASSANDRA-5614-Memtable-updates-with-RowTombstone-up.patch
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-16 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5614:
---

bq. When a column is deleted by name and that column is present in the 
memtable, we have the value and so can do that. When the named column isn't in 
the memtable, then we don't have the old value

Right, but we know the old value is in the sstable and will be cleaned out on 
compaction.

So I still don't see what would break here if we "expand" the tombstone to the 
indexed columns -- the same logic applies, we either get it from the memtable 
or at compaction time.

(I *think* we apply row tombstones to indexed data correctly in compaction 
already -- if so, all we need to do is handle the memtable case, and not 
actually create extra tombstones.)

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-12 Thread Sam Tunnicliffe (JIRA)

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

Sam Tunnicliffe commented on CASSANDRA-5614:


To delete from the 2i cf you need the old column value to derive the 2i cf key. 
When a column is deleted by name and that column is present in the memtable, we 
have the value and so can do that. When the named column isn't in the memtable, 
then we don't have the old value so we skip the delete and treat the operation 
as an insert. In SIM.StandardUpdater this is a no-op when isMarkedForDelete() 
== true, so even when the column is named if it's not in the memtable 
ASPCSI.delete is never called.

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-12 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-5614:
---

I don't see how this is different from "pretend the user had deleted the 
indexed columns by name" as far as read-before-write goes.


> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-07-12 Thread Sam Tunnicliffe (JIRA)

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

Sam Tunnicliffe commented on CASSANDRA-5614:


I'm tempted to say that this is not a problem because it works as expected with 
both KeysIndex & CompositesIndex. Yes, the presence of range rather than 
individual column tombstones in the DeletionInfo means that the index isn't 
updated directly at update time, but the index repair-on-read compensates for 
that at query time. 

We could take the deletion info from the update & use that in some new 
deleteAll method on SIM.Updater which iterates through the indexed columns 
issuing deletes, but AFAICT that would require reads to aquire the existing 
indexed values.

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Tunnicliffe
>Priority: Minor
> Fix For: 1.2.7
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CASSANDRA-5614) W/O specified columns ASPCSI does not get notified of deletes

2013-06-05 Thread Benjamin Coverston (JIRA)

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

Benjamin Coverston commented on CASSANDRA-5614:
---

Instead of expanding them, at least for the purposes of what I'm doing I would 
be OK with just getting keybytes, and column if column had a special marker for 
a row tombstone.

> W/O specified columns ASPCSI does not get notified of deletes
> -
>
> Key: CASSANDRA-5614
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5614
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.2.0
>Reporter: Benjamin Coverston
>Assignee: Sam Overton
>Priority: Minor
> Fix For: 1.2.6
>
>
> I'm working on a secondary index implementation based on the composite index 
> type.
> AbstractSimplePerColumnSecondaryIndex.java#delete is not called when CQL 
> delete statements do not specify columns.
> When I specify columns it is called. Pretty sure this is a bug.
> Setup:
> {code}
> cqlsh> create KEYSPACE foo WITH replication = {'class': 'SimpleStrategy' , 
> 'replication_factor': 1};
> cqlsh> use foo;
> cqlsh:foo> CREATE TABLE albums (artist text, album text, rating int, release 
> int, PRIMARY KEY (artist, album));
> cqlsh:foo> CREATE INDEX ON albums (rating);
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> Does not get called here:
> {code}
> cqlsh:foo> DELETE FROM albums where artist='artist' and album='album';
> {code}
> {code}
> cqlsh:foo> insert into albums (artist, album, rating, release) VALUES 
> ('artist', 'album', 1, 2);
> {code}
> gets called here:
> {code}
> cqlsh:foo> DELETE rating FROM albums where artist='artist' and album='album';
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira