Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 2.33 KB

isolation.md

File metadata and controls

51 lines (40 loc) · 2.33 KB

Apache Accumulo Isolation Example

Accumulo has an isolated scanner that ensures partial changes to rows are not seen. Isolation is documented in ../docs/isolation.html and the user manual.

InterferenceTest is a simple example that shows the effects of scanning with and without isolation. This program starts two threads. One thread continually updates all the values in a row to be the same thing, but different from what it used to be. The other thread continually scans the table and checks that all values in a row are the same. Without isolation the scanning thread will sometimes see different values, which is the result of reading the row at the same time a mutation is changing the row.

Below, Interference Test is run without isolation enabled for 5000 iterations and it reports problems.

$ accumulo shell -u <username> -p <password> -e 'createnamespace examples' 
$ ./bin/runex isolation.InterferenceTest -t examples.isotest --iterations 50000
ERROR Columns in row 053 had multiple values [53, 4553]
ERROR Columns in row 061 had multiple values [561, 61]
ERROR Columns in row 070 had multiple values [570, 1070]
ERROR Columns in row 079 had multiple values [1079, 1579]
ERROR Columns in row 088 had multiple values [2588, 1588]
ERROR Columns in row 106 had multiple values [2606, 3106]
ERROR Columns in row 115 had multiple values [4615, 3115]
finished

Below, Interference Test is run with isolation enabled for 5000 iterations and it reports no problems.

$ ./bin/runex isolation.InterferenceTest -t examples.isotest --iterations 50000 --isolated
finished