Description
mvccPreAssign was brought by HBASE-16698, which truly improved the performance of writing, especially in ASYNC_WAL scenario. But mvccPreAssign was only used in doMiniBatchMutate, not in Increment/Append path. If Increment/Append and batch put are using against the same region in parallel, then seqid of the same region may not monotonically increasing in the WAL. Since one write path acquires mvcc/seqid before append, and the other acquires in the append/sync consume thread.
The out of order situation can easily reproduced by a simple UT, which was attached in the attachment. I modified the code to assert on the disorder:
if(this.highestSequenceIds.containsKey(encodedRegionName)) { assert highestSequenceIds.get(encodedRegionName) < sequenceid; }
I'd like to say, If we allow disorder in WALs, then this is not a issue.
But as far as I know, if highestSequenceIds is not properly set, some WALs may not archive to oldWALs correctly.
which I haven't figure out yet is that, will disorder in WAL cause data loss when recovering from disaster? If so, then it is a big problem need to be fixed.
I have fix this problem in our costom1.1.x branch, my solution is using mvccPreAssign everywhere, making it un-configurable. Since mvccPreAssign it is indeed a better way than assign seqid in the ringbuffer thread while keeping handlers waiting for it.
If anyone think it is doable, then I will port it to branch-1 and master branch and upload it.
Attachments
Attachments
Issue Links
- is broken by
-
HBASE-16698 Performance issue: handlers stuck waiting for CountDownLatch inside WALKey#getWriteEntry under high writing workload
- Resolved
- supercedes
-
HBASE-17509 Remove the mvcc preassign lock and take usage of MVCC internal lock instead
- Resolved