nyl3532016 commented on a change in pull request #2814:
URL: https://github.com/apache/hbase/pull/2814#discussion_r549594528



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java
##########
@@ -140,7 +146,7 @@ public WriteEntry begin() {
   public WriteEntry begin(Runnable action) {
     synchronized (writeQueue) {
       long nextWriteNumber = writePoint.incrementAndGet();
-      WriteEntry e = new WriteEntry(nextWriteNumber);
+      WriteEntry e = 
cachedWriteEntries.get().setWriteNumber(nextWriteNumber).markCompleted(false);

Review comment:
       after change `WriteEntry` to threadlocal.
   It is ok to this scene in one thread: `mvcc1(begin)---mvcc1(wait 
complete)---mvcc2(begin)---mvcc2(wait complete)`
   but is bad to the scene in one thread: 
`mvcc1(begin)---mvcc2(begin)---mvcc1(wait complete)---mvcc2(wait complete)`
   I think our usage of `WriteEntry` is the former




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to