[ 
http://jira.amdatu.org/jira/browse/AMDATU-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10182#comment-10182
 ] 

Ivo Ladage - van Doorn commented on AMDATU-137:
-----------------------------------------------

Took some time to figure this out, but the problem is that Cassandra uses a 
asynchronous write strategy. Although the API documentation concerning 
consistency strategies seem to imply that you can achieve synchronous write 
behavior, this is not the case. In essence: when performing a IFace.insert with 
value 'x', a subsequent IFace.get on the same row is never guaranteed to return 
the value 'x'.
The reason is that in Cassandra read and write operations are clearly 
separated. Write operations are handled by a proxy which adds the 'write 
requests' to some nodes in the cluster. The write consistency levels only makes 
guarantees about adding these write requests to a minimum amount of nodes in 
the cluster. 
Read consistency levels only guarantee that at least n nodes in the cluster are 
asked to return the latest value for a certain row and that the value with the 
highest timestamp is returned.
However, there is never any guarantee that when a node A writes the value X to 
rowkey R that a subsequent call to retrieve the value of rowkey R on node A 
returns X. Read and write are two separate worlds and there is no way to ensure 
that 'all write requests' for a certain are handled before reading data from a 
row. 


> Running the integration tests fails at random
> ---------------------------------------------
>
>                 Key: AMDATU-137
>                 URL: http://jira.amdatu.org/jira/browse/AMDATU-137
>             Project: Amdatu
>          Issue Type: Bug
>            Reporter: Ivo Ladage - van Doorn
>            Assignee: Ivo Ladage - van Doorn
>            Priority: Blocker
>             Fix For: 0.0.6
>
>
> After updating to the latest trunk revision and performing a mvn clean 
> install, the integration test keeps failing with errors that vary. 
> The test that fails is org.amdatu.test.integration.tests.UserAdminStoreTest, 
> but the exact error varies:
> junit.framework.AssertionFailedError: Group 'TestGuestUsers' has 1 basic 
> members. Expected: 3. Members found: TestAdministrator 
>       at junit.framework.Assert.fail(Assert.java:47)
>       at junit.framework.Assert.assertTrue(Assert.java:20)
>       at 
> org.amdatu.test.integration.tests.UserAdminStoreTest.assertBasicMemberCount(UserAdminStoreTest.java:175)
>       at 
> org.amdatu.test.integration.tests.UserAdminStoreTest.run(UserAdminStoreTest.java:141)
> or
> junit.framework.AssertionFailedError: Group 'TestGuestUsers' has 2 basic 
> members. Expected: 3. Members found: TestAdministrator TestEditor 
>       at junit.framework.Assert.fail(Assert.java:47)
>       at junit.framework.Assert.assertTrue(Assert.java:20)
>       at 
> org.amdatu.test.integration.tests.UserAdminStoreTest.assertBasicMemberCount(UserAdminStoreTest.java:176)
>       at 
> org.amdatu.test.integration.tests.UserAdminStoreTest.run(UserAdminStoreTest.java:142)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to