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

Stefania edited comment on CASSANDRA-9649 at 6/26/15 3:56 AM:
--------------------------------------------------------------

[~slebresne] thanks for the patch. I made a tiny change to pick up as much of 
your code as possible in the unit tests. I created a pull request 
[here|https://github.com/pcmanus/cassandra/pull/52]. Sorry about the rebase.

The patch seems to apply to 2.2 so nothing to do other than monitoring CI.

For 2.0 I'm not sure if it helps but rather than just calling 
{{UUIDGen.getTimeUUID()}} I modified {{UUIDGen.getTimeUUID(long when)}} to do 
the same thing as the override without any arguments. It seems to be called 
only by a test method and by {{StorageProxy.beginAndRepairPaxos()}}. One thing 
that is not clear to me is why isn't {{UUIDGen.lastNanos}} an atomic long?

I guess you could put yourself as the author and myself as the reviewer.

My branches:

https://github.com/stef1927/cassandra/tree/9649-2.0
https://github.com/stef1927/cassandra/tree/9649-2.1
https://github.com/stef1927/cassandra/tree/9649-2.2

The CI views:

http://cassci.datastax.com/job/stef1927-9649-2.0-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.0-dtest/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.1-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.1-dtest/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.2-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.2-dtest/lastCompletedBuild/testReport/




was (Author: stefania):
[~slebresne] thanks for the patch. I made a tiny change to pick up as much of 
your code as possible in the unit tests. I created a pull request 
[here|https://github.com/pcmanus/cassandra/pull/52]. Sorry about the rebase.

The patch seems to apply to 2.2 so nothing to do other than monitoring CI.

For 2.0 I'm not sure if it helps but rather than just calling 
{{UUIDGen.getTimeUUID()}} I modified {{UUIDGen.getTimeUUID(long when)}} to do 
the same thing as the override without any arguments. It seems to be called 
only by a test method and by {{StorageProxy.beginAndRepairPaxos()}}. One thing 
that is not clear to me is why isn't {{UUIDGen.lastNanos}} an atomic long?

I guess you could put yourself as the author and myself as the reviewer, or 
vice-versa, as you prefer.

My branches:

https://github.com/stef1927/cassandra/tree/9649-2.0
https://github.com/stef1927/cassandra/tree/9649-2.1
https://github.com/stef1927/cassandra/tree/9649-2.2

The CI views:

http://cassci.datastax.com/job/stef1927-9649-2.0-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.0-dtest/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.1-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.1-dtest/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.2-testall/lastCompletedBuild/testReport/
http://cassci.datastax.com/job/stef1927-9649-2.2-dtest/lastCompletedBuild/testReport/



> Paxos ballot in StorageProxy could clash
> ----------------------------------------
>
>                 Key: CASSANDRA-9649
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9649
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Stefania
>            Assignee: Stefania
>            Priority: Minor
>
> This code in {{StorageProxy.beginAndRepairPaxos()}} takes a timestamp in 
> microseconds but divides it by 1000 before adding one. So if the summary is 
> null, ballotMillis would be the same for up to 1000 possible state timestamp 
> values:
> {code}
>     long currentTime = (state.getTimestamp() / 1000) + 1;
>     long ballotMillis = summary == null
>                                  ? currentTime
>                                  : Math.max(currentTime, 1 +    
> UUIDGen.unixTimestamp(summary.mostRecentInProgressCommit.ballot));
>     UUID ballot = UUIDGen.getTimeUUID(ballotMillis);
> {code}
> {{state.getTimestamp()}} returns the time in micro seconds and it ensures to 
> add one microsecond to any previously used timestamp if the client sends the 
> same or an older timestamp. 
> Initially I used this code in {{ModificationStatement.casInternal()}}, 
> introduced by CASSANDRA-9160 to support cas unit tests, but occasionally 
> these tests were failing. It was only when I ensured uniqueness of the ballot 
> that the tests started to pass reliably.
> I wonder if we could ever have the same issue in StorageProxy?
> cc [~jbellis] and [~slebresne] for CASSANDRA-7801



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

Reply via email to