[ 
https://issues.apache.org/jira/browse/HBASE-25975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Kyle Purtell updated HBASE-25975:
----------------------------------------
    Comment: was deleted

(was: As of version 90bf60d7:
 - Reduced time under lock
 - Drop (and then reacquire) row locks for batch mutations when yielding

With RowCommitSequencer 0% contention case:
{noformat}
   1 threads    1 rows 100 iterations, ms/op: p50=0.0178 p99=0.0178, 
p999=0.0178 max=4.2594
   2 threads    1 rows 100 iterations, ms/op: p50=0.0168 p99=0.0218, 
p999=0.0219 max=1.5286
   4 threads    1 rows 100 iterations, ms/op: p50=0.0216 p99=0.0237, 
p999=0.0237 max=1.5467
   8 threads    1 rows 100 iterations, ms/op: p50=0.0188 p99=0.0210, 
p999=0.0210 max=1.6593
  16 threads    1 rows 100 iterations, ms/op: p50=0.0104 p99=0.0121, 
p999=0.0122 max=1.8361
  32 threads    1 rows 100 iterations, ms/op: p50=0.0086 p99=0.0103, 
p999=0.0103 max=2.0058
   1 threads   10 rows 100 iterations, ms/op: p50=0.0145 p99=0.0145, 
p999=0.0146 max=1.4548
   2 threads   10 rows 100 iterations, ms/op: p50=0.0143 p99=0.0149, 
p999=0.0149 max=1.4992
   4 threads   10 rows 100 iterations, ms/op: p50=0.0198 p99=0.0228, 
p999=0.0229 max=1.5066
   8 threads   10 rows 100 iterations, ms/op: p50=0.0212 p99=0.0261, 
p999=0.0263 max=1.5166
  16 threads   10 rows 100 iterations, ms/op: p50=0.0220 p99=0.0238, 
p999=0.0239 max=1.8410
  32 threads   10 rows 100 iterations, ms/op: p50=0.0161 p99=0.0185, 
p999=0.0186 max=3.6196
   1 threads  100 rows 100 iterations, ms/op: p50=0.1123 p99=0.1123, 
p999=0.1123 max=1.9413
   2 threads  100 rows 100 iterations, ms/op: p50=0.1367 p99=0.1442, 
p999=0.1443 max=3.5486
   4 threads  100 rows 100 iterations, ms/op: p50=0.1246 p99=0.1388, 
p999=0.1388 max=1.8716
   8 threads  100 rows 100 iterations, ms/op: p50=0.1285 p99=0.1409, 
p999=0.1412 max=2.5808
  16 threads  100 rows 100 iterations, ms/op: p50=0.1428 p99=0.1617, 
p999=0.1618 max=5.3348
  32 threads  100 rows 100 iterations, ms/op: p50=0.2661 p99=0.2771, 
p999=0.2771 max=6.7746
   1 threads 1000 rows 100 iterations, ms/op: p50=1.0504 p99=1.0504, 
p999=1.0505 max=1.7992
   2 threads 1000 rows 100 iterations, ms/op: p50=1.1822 p99=1.1831, 
p999=1.1834 max=3.9861
   4 threads 1000 rows 100 iterations, ms/op: p50=1.3089 p99=1.3162, 
p999=1.3164 max=5.9125
   8 threads 1000 rows 100 iterations, ms/op: p50=1.8113 p99=1.9187, 
p999=1.9222 max=12.9611
  16 threads 1000 rows 100 iterations, ms/op: p50=2.2035 p99=2.5463, 
p999=2.5489 max=44.3674
  32 threads 1000 rows 100 iterations, ms/op: p50=2.2668 p99=2.3482, 
p999=2.3495 max=94.2172
{noformat}
With RowCommitSequencer 100% contention case:
{noformat}
   1 threads    1 rows 100 iterations, ms/op: p50=0.0077 p99=0.0077, 
p999=0.0077 max=1.4200
   2 threads    1 rows 100 iterations, ms/op: p50=0.0073 p99=0.0075, 
p999=0.0075 max=12.4625
   4 threads    1 rows 100 iterations, ms/op: p50=0.0101 p99=0.0149, 
p999=0.0149 max=28.0596
   8 threads    1 rows 100 iterations, ms/op: p50=0.0220 p99=0.0257, 
p999=0.0257 max=49.3666
  16 threads    1 rows 100 iterations, ms/op: p50=0.0099 p99=0.0108, 
p999=0.0108 max=149.5916
  32 threads    1 rows 100 iterations, ms/op: p50=0.0065 p99=0.0087, 
p999=0.0089 max=334.0086
   1 threads   10 rows 100 iterations, ms/op: p50=0.0141 p99=0.0141, 
p999=0.0142 max=1.4576
   2 threads   10 rows 100 iterations, ms/op: p50=0.0128 p99=0.0287, 
p999=0.0288 max=6.6118
   4 threads   10 rows 100 iterations, ms/op: p50=0.0159 p99=0.0294, 
p999=0.0296 max=29.0581
   8 threads   10 rows 100 iterations, ms/op: p50=0.0320 p99=0.0341, 
p999=0.0341 max=51.0105
  16 threads   10 rows 100 iterations, ms/op: p50=0.0300 p99=0.0319, 
p999=0.0319 max=118.6424
  32 threads   10 rows 100 iterations, ms/op: p50=0.0327 p99=0.0348, 
p999=0.0348 max=266.9346
   1 threads  100 rows 100 iterations, ms/op: p50=0.1135 p99=0.1135, 
p999=0.1135 max=2.9177
   2 threads  100 rows 100 iterations, ms/op: p50=0.1155 p99=0.1185, 
p999=0.1190 max=6.3378
   4 threads  100 rows 100 iterations, ms/op: p50=0.1798 p99=0.1885, 
p999=0.1885 max=16.2247
   8 threads  100 rows 100 iterations, ms/op: p50=0.1612 p99=0.2008, 
p999=0.2008 max=53.4349
  16 threads  100 rows 100 iterations, ms/op: p50=0.1668 p99=0.1787, 
p999=0.1789 max=112.3902
  32 threads  100 rows 100 iterations, ms/op: p50=1.8235 p99=1.8235, 
p999=1.8235 max=2.6192
   1 threads 1000 rows 100 iterations, ms/op: p50=1.0348 p99=1.0348, 
p999=1.0348 max=4.1228
   2 threads 1000 rows 100 iterations, ms/op: p50=1.1168 p99=1.1168, 
p999=1.1168 max=1.5656
   4 threads 1000 rows 100 iterations, ms/op: p50=1.0995 p99=1.0995, 
p999=1.0995 max=1.7217
   8 threads 1000 rows 100 iterations, ms/op: p50=1.0396 p99=1.0396, 
p999=1.0396 max=2.7517
  16 threads 1000 rows 100 iterations, ms/op: p50=1.1113 p99=1.1113, 
p999=1.1113 max=3.4974
  32 threads 1000 rows 100 iterations, ms/op: p50=1.3048 p99=1.3048, 
p999=1.3048 max=9.2236
{noformat}
Repeating the JMH microbenchmarks of HRegion.RowCommitSequencer.getRowSequence:


 * The p99 of the single thread 1 row case is 75 ns, the p999 is 969 ns, and 
the max is 62144 ns (0.062 ms).


* The p99 of the single thread 1000 row case is 74 ns, the p999 is 980 ns, and 
the max is 71424 ns (0.071 ms).


* The p99 of the 8 thread 1 row case is 36244 ns (0.036 ms), the p999 is 88576 
ns (0.089 ms), and the max is 3018752 ns (3.019 ms).

* The p99 of the 8 thread 1000 row case is 36554 ns (0.037 ms), the p999 is 
91264 ns (0.091 ms), and the max is 3112960 ns (3.113 ms).

 )

> Row commit sequencer
> --------------------
>
>                 Key: HBASE-25975
>                 URL: https://issues.apache.org/jira/browse/HBASE-25975
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver
>            Reporter: Andrew Kyle Purtell
>            Assignee: Andrew Kyle Purtell
>            Priority: Major
>             Fix For: 2.5.0, 3.0.0-alpha-2
>
>
> Use a row commit sequencer in HRegion to ensure that only the operations that 
> mutate disjoint sets of rows are able to commit within the same clock tick. 
> This maintains the invariant that more than one mutation to a given row will 
> never be committed in the same clock tick.
> Callers will first acquire row locks for the row(s) the pending mutation will 
> mutate. Then they will use RowCommitSequencer.getRowSequence to ensure that 
> the set of rows about to be mutated do not overlap with those for any other 
> pending mutations in the current clock tick. If an overlap is identified, 
> getRowSequence will yield and loop until there is no longer an overlap and 
> the caller's pending mutation can succeed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to