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/11/23 15:31:11 UTC

[jira] [Commented] (CASSANDRA-10749) DeletionTime.compareTo wrong ??

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

Sylvain Lebresne commented on CASSANDRA-10749:
----------------------------------------------

That definitively is an oversight, care to provide a patch?
I'll note that this is actually pretty old, dating back from the patch for CASSANDRA-3708. Also, this is pretty much innocuous: if 2 {{DeletionTime}} have the same {{markedForDeleteAt}}, their {{localDeletionTime}} will likely be the same, and if not will be very close and we don't really care all that much how we sort them. We should still fix it of course.

> DeletionTime.compareTo wrong ??
> -------------------------------
>
>                 Key: CASSANDRA-10749
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10749
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Robert Stupp
>            Priority: Minor
>
> {{org.apache.cassandra.db.DeletionTime#compareTo}} looks like this:
> {code}
>     public int compareTo(DeletionTime dt)
>     {
>         if (markedForDeleteAt() < dt.markedForDeleteAt())
>             return -1;
>         else if (markedForDeleteAt() > dt.markedForDeleteAt())
>             return 1;
>         else if (localDeletionTime() < dt.localDeletionTime())
>             return -1;
>         else if (localDeletionTime() > dt.localDeletionTime())
>             return -1;
>         else
>             return 0;
>     }
> {code}
> I think that {{localDeletionTime() > dt.localDeletionTime()}} should return {{1}}, but I'm not sure. /cc [~slebresne]



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