Apache9 commented on code in PR #4859:
URL: https://github.com/apache/hbase/pull/4859#discussion_r1011243971
##########
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:
Here we also modified the scannerReadPoints? Why just use read lock here?
--
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]