From 7a4836b038cdb93b8c90a7f7f4669ccd8faa18f7 Mon Sep 17 00:00:00 2001 From: Sergey Soldatov Date: Wed, 25 May 2022 21:01:05 -0700 Subject: [PATCH] HBASE-27061 two phase bulkload is broken when SFT is in use. --- .../org/apache/hadoop/hbase/regionserver/HRegion.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 1acbf162b098..a6a0f5634817 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -357,7 +357,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi private final int rowLockWaitDuration; static final int DEFAULT_ROWLOCK_WAIT_DURATION = 30000; - private Path regionDir; + private Path regionWalDir; private FileSystem walFS; // set to true if the region is restored from snapshot for reading by ClientSideRegionScanner @@ -2147,11 +2147,11 @@ FileSystem getWalFileSystem() throws IOException { * @throws IOException if there is an error getting WALRootDir */ public Path getWALRegionDir() throws IOException { - if (regionDir == null) { - regionDir = CommonFSUtils.getWALRegionDir(conf, getRegionInfo().getTable(), + if (regionWalDir == null) { + regionWalDir = CommonFSUtils.getWALRegionDir(conf, getRegionInfo().getTable(), getRegionInfo().getEncodedName()); } - return regionDir; + return regionWalDir; } @Override @@ -7255,7 +7255,7 @@ public Map> bulkLoadHFiles(Collection> f boolean reqTmp = store.storeEngine.requireWritingToTmpDirFirst(); if (bulkLoadListener != null) { finalPath = bulkLoadListener.prepareBulkLoad(familyName, path, copyFile, - reqTmp ? null : regionDir.toString()); + reqTmp ? null : fs.getRegionDir.toString()); } Pair pair = null; if (reqTmp) {