You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bb...@apache.org on 2023/11/30 23:40:49 UTC
(hbase) 01/01: HBASE-28222 Leak in ExportSnapshot during verifySnapshot on S3A
This is an automated email from the ASF dual-hosted git repository.
bbeaudreault pushed a commit to branch HBASE-28222
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 31dd2837ffeca8ec85cdf8e00902b2f3c0666033
Author: Bryan Beaudreault <bb...@hubspot.com>
AuthorDate: Thu Nov 30 15:32:26 2023 -0500
HBASE-28222 Leak in ExportSnapshot during verifySnapshot on S3A
Revert "HBASE-12819 ExportSnapshot doesn't close FileSystem instances"
This reverts commit ee32eebeab38be4e171c6aaf362aff9a584a37f3
---
.../org/apache/hadoop/hbase/snapshot/ExportSnapshot.java | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
index f2a8e00fea5..c6f655c3730 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
@@ -59,7 +59,6 @@ import org.apache.hadoop.hbase.util.FSUtils;
import org.apache.hadoop.hbase.util.HFileArchiveUtil;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.io.BytesWritable;
-import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.InputFormat;
@@ -211,14 +210,12 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
outputArchive = new Path(outputRoot, HConstants.HFILE_ARCHIVE_DIRECTORY);
try {
- srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
} catch (IOException e) {
throw new IOException("Could not get the input FileSystem with root=" + inputRoot, e);
}
try {
- destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
outputFs = FileSystem.get(outputRoot.toUri(), destConf);
} catch (IOException e) {
throw new IOException("Could not get the output FileSystem with root=" + outputRoot, e);
@@ -241,12 +238,6 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
}
}
- @Override
- protected void cleanup(Context context) {
- IOUtils.closeStream(inputFs);
- IOUtils.closeStream(outputFs);
- }
-
@Override
public void map(BytesWritable key, NullWritable value, Context context)
throws InterruptedException, IOException {
@@ -990,10 +981,8 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
}
Configuration srcConf = HBaseConfiguration.createClusterConf(conf, null, CONF_SOURCE_PREFIX);
- srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
FileSystem inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
Configuration destConf = HBaseConfiguration.createClusterConf(conf, null, CONF_DEST_PREFIX);
- destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
FileSystem outputFs = FileSystem.get(outputRoot.toUri(), destConf);
boolean skipTmp = conf.getBoolean(CONF_SKIP_TMP, false)
|| conf.get(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR) != null;
@@ -1149,9 +1138,6 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
}
outputFs.delete(outputSnapshotDir, true);
return 1;
- } finally {
- IOUtils.closeStream(inputFs);
- IOUtils.closeStream(outputFs);
}
}