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

Stefania commented on CASSANDRA-9160:
-------------------------------------

Thanks, I've rebased the 2.1 and 2.2 patches and moved CQLTester back to cql3. 
I also re-housed a new test that had cropped in (CASSANDRA-9565). The 2.2 patch 
should apply to trunk so I removed the trunk patch as it was out of date. CI is 
currently running.

bq. Could you elaborate and/or provide a scenario in which the current +1ms 
logic would fail under load on beginAndRepairPaxos? It's not immediately 
apparent to me but there's possibly more subtlety surrounding state at that 
time that I'm not familiar with.

Well here is my reasoning: 

- 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. 
- this code in beginAndRepairPaxos() takes that value but divides 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}

Initially I used this code in ModificationStatement.casInternal() and 
occasionally cas tests were failing.

> Migrate CQL dtests to unit tests
> --------------------------------
>
>                 Key: CASSANDRA-9160
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9160
>             Project: Cassandra
>          Issue Type: Test
>            Reporter: Sylvain Lebresne
>            Assignee: Stefania
>
> We have CQL tests in 2 places: dtests and unit tests. The unit tests are 
> actually somewhat better in the sense that they have the ability to test both 
> prepared and unprepared statements at the flip of a switch. It's also better 
> to have all those tests in the same place so we can improve the test 
> framework in only one place (CASSANDRA-7959, CASSANDRA-9159, etc...). So we 
> should move the CQL dtests to the unit tests (which will be a good occasion 
> to organize them better).



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

Reply via email to