hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/3] hbase git commit: HBASE-21069 NPE in StoreScanner.updateReaders causes RS to crash
Date Mon, 20 Aug 2018 22:31:46 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 22d2c72c0 -> 7e473dded
  refs/heads/branch-1.3 d1b0c3223 -> e81832f41


HBASE-21069 NPE in StoreScanner.updateReaders causes RS to crash


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1243968d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1243968d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1243968d

Branch: refs/heads/branch-1.3
Commit: 1243968de1daacf1a3d3307015ed943dc77e87ad
Parents: d1b0c32
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Aug 17 15:34:18 2018 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon Aug 20 15:16:29 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/StoreScanner.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1243968d/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
index da2f5ae..c3f3d07 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
@@ -816,7 +816,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
   @Override
   public void updateReaders(List<StoreFile> sfs, List<KeyValueScanner> memStoreScanners)
throws IOException {
     if (CollectionUtils.isEmpty(sfs)
-      && CollectionUtils.isEmpty(memStoreScanners)) {
+      && (memStoreScanners == null || CollectionUtils.isEmpty(memStoreScanners)))
{
       return;
     }
     flushLock.lock();
@@ -824,7 +824,9 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
       if (this.closing) {
         // Lets close scanners created by caller, since close() won't notice this.
         // memStoreScanners is immutable, so lets create a new list.
-        clearAndClose(new ArrayList<>(memStoreScanners));
+        if (memStoreScanners != null) {
+          clearAndClose(new ArrayList<>(memStoreScanners));
+        }
         return;
       }
       flushed = true;
@@ -839,7 +841,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
       List<KeyValueScanner> scanners = store.getScanners(sfs, cacheBlocks, get, usePread,
         isCompaction, matcher, scan.getStartRow(), scan.getStopRow(), this.readPt, false);
       flushedstoreFileScanners.addAll(scanners);
-      if (!CollectionUtils.isEmpty(memStoreScanners)) {
+      if (memStoreScanners != null && !CollectionUtils.isEmpty(memStoreScanners))
{
         clearAndClose(memStoreScannersAfterFlush);
         memStoreScannersAfterFlush.addAll(memStoreScanners);
       }


Mime
View raw message