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

Keith Turner edited comment on ACCUMULO-1614 at 9/5/13 1:23 AM:
----------------------------------------------------------------

In the percolator prototype I am working on I have a test that randomly 
transfers money between bank accounts.  In this test the sum of all money in 
all bank accounts should never change.  Percolator allows this to be done 
across rows.  Using conditional mutations, this test could easily be done 
within rows.

Could have a test that simulates a lot banks and randomly transfer money 
between accounts within a bank.  Data would look something like the following

row=bank01  cf=acct01 cq=bal  val=100,1
row=bank01  cf=acct02 cq=bal  val=100,1
row=bank01  cf=acct03 cq=bal  val=100,1

The value contains a balance and seq num.  The sequence number is a one up 
counter that prevents concurrent updates to an account, even if the updates try 
to add the same amount to an account.

The random walk test would pick a random bank and then pick two random columns 
to transfer money between.  Below is an example that uses the sample data above 
and shows two threads trying to transfer 10 to acct01.

 # Thread 1 : read bank01:acct01:bal
 # Thread 1 : read bank01:acct03:bal
 # Thread 2 : read bank01:acct01:bal
 # Thread 2 : read bank01:acct02:bal
 # Thread 1 : Write mutation that sets  bank01:acct01:bal=110,2 and 
bank01:acct03:bal=90,2 ONLY IF bank01:acct01:bal==100,1 and 
bank01:acct03:bal==100,1
 # Thread 2 : Write mutation that sets  bank01:acct01:bal=110,2 and 
bank01:acct02:bal=90,2 ONLY IF bank01:acct01:bal==100,1 and 
bank01:acct02:bal==100,1 

Thread 1 will succeed and thread 2 will fail.

It should be possible to run an isolated scan over the bank rows at any point 
in time and get a predictable result (even in the face of concurrent updates 
because only entire mutations are seen).  For example the sum of all money in 
bank01 should always be 300.

The random walk test could do transfers and verifies.  To get concurreny, run 
multiple random walkers against the same table.








                
      was (Author: kturner):
    Could have a test that simulates a lot banks and randomly transfer money 
between accounts within a bank.  Data would look something like the following

row=bank01  cf=acct01 cq=bal  val=100,1
row=bank01  cf=acct02 cq=bal  val=100,1
                  
> Create random walk test that use conditional writer
> ---------------------------------------------------
>
>                 Key: ACCUMULO-1614
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1614
>             Project: Accumulo
>          Issue Type: Sub-task
>          Components: client, tserver
>            Reporter: Keith Turner
>             Fix For: 1.6.0
>
>
> Need to create random walk test that use conditional writer or modify 
> existing random walk test to use conditional writer.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to