frostruan commented on code in PR #4859:
URL: https://github.com/apache/hbase/pull/4859#discussion_r1011630652


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java:
##########
@@ -130,19 +130,34 @@ private static boolean hasNonce(HRegion region, long 
nonce) {
     long mvccReadPoint = PackagePrivateFieldAccessor.getMvccReadPoint(scan);
     this.scannerReadPoints = region.scannerReadPoints;
     this.rsServices = region.getRegionServerServices();
-    synchronized (scannerReadPoints) {
-      if (mvccReadPoint > 0) {
-        this.readPt = mvccReadPoint;
-      } else if (hasNonce(region, nonce)) {
-        this.readPt = 
rsServices.getNonceManager().getMvccFromOperationContext(nonceGroup, nonce);
-      } else {
-        this.readPt = region.getReadPoint(isolationLevel);
+    if (region.useReadWriteLockForReadPoints) {
+      region.scannerReadPointsLock.readLock().lock();
+      try {
+        this.readPt = calculateReadPoint(isolationLevel, mvccReadPoint, 
nonceGroup, nonce);
+        scannerReadPoints.put(this, this.readPt);

Review Comment:
   When we do delta operation like increment/append, we will need to get the 
smallest read point.
   
   If we both have heavy delta operation load and heavy read load,  the write 
lock may reduce the write performance. so let's introduce a flag to make this 
decided by the user.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to