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

Sam Tunnicliffe commented on CASSANDRA-7313:
--------------------------------------------

I don't see a problem with the {{remove()}} method of the iterator obtained 
from columnDefs.iterator, a quick test shows that it does in fact remove from 
the underlying Set when invoked. My theory would be that the issue is actually 
with the equality check between ByteBuffers. 
Adding a unit test would let us verify whether or not the patch actually has 
some effect (I suspect that it doesn't). If that isn't the case I would dig 
into the name comparison.

(n.b. I'm assuming the affects version should be 2.1 here as the patch doesn't 
apply to 2.0)

> SecondaryIndex not deleting column definition
> ---------------------------------------------
>
>                 Key: CASSANDRA-7313
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7313
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Andrés de la Peña
>            Priority: Minor
>              Labels: 2i, columnDefinition, secondaryIndex
>         Attachments: dSecondaryIndex-removeColumnDef.diff.txt
>
>
> The method _SecondaryIndex#removeColumnDef_ does not delete the requested 
> column definition. I think this may be due to the iterator's remove method:
> {code:java}
> void removeColumnDef(ByteBuffer name)
>     {
>         Iterator<ColumnDefinition> it = columnDefs.iterator();
>         while (it.hasNext())
>         {
>             if (it.next().name.bytes.equals(name))
>                 it.remove();
>         }
>     }
> {code}
> For me it has been problematic when deleting a per row index in a column 
> family and then creating a new one.
> I attach a patch that may solve the problem.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to