VCNC/haeinsa

Improve performance with async rpc

Opened this issue · 0 comments

Performance of Haeinsa transaction can be improve with asynchronous RPC in HBase. If AsyncHBaseClient (which implementation was mentioned on HBASE-2182) is support on HBase, We can use this Client and improve performance of Haeinsa.

Commit operation of Haeinsa transaction consists of following sequence of operations.

  1. prewrite primary row.
  2. prewrite secondary rows.
  3. commit primary row.
  4. apply mutations to secondary rows.
  5. make secondary rows stable.
  6. make primary row stable.

Note that each of 2nd, 4th, 5th operations runs several HBase operation to several secondary rows. In here, series of HBase operations in 2nd step can run concurrently. Series of HBase operations of each of 4th and 5th step can be run concurrently too. To make Haesina transaction robust, following conditions should be meet:

  • 2nd step can run concurrently only after 1st step is succeed.
  • After all of operations of 2nd stop succeed, 3rd step can be started.
  • Execution of each step should be strictly ordered.
  • But, operations in each step can run concurrently.

Tricky part of this optimization is 4th step. Order of mutations in each secondary row, order of checkAndPut and checkAndDelete should be strictly kept.

With this optimization, latency of transaction can be reduced, which come to low conflict rate of transactions. (But, simultaneously, it can cause more operations a bit which means more throughput is need on HBase to use Haeinsa)