diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java index ea655a25d58d..b02166030464 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java @@ -350,11 +350,18 @@ public static void setWALRootDir(final Configuration c, final Path root) { public static FileSystem getWALFileSystem(final Configuration c) throws IOException { Path p = getWALRootDir(c); FileSystem fs = p.getFileSystem(c); - // hadoop-core does fs caching, so need to propogate this if set + // hadoop-core does fs caching, so need to propagate this if set String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE); if (enforceStreamCapability != null) { fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability); } + if (!c.getBoolean(HConstants.CLUSTER_DISTRIBUTED, false)) { + // running in standalone mode, assume RawLocalFileSystem does not support + // required capabilities `HSYNC` and `HFLUSH`, so disable enforcement. + LOG.warn("Cannot enforce durability guarantees while running in" + + " standalone mode ({}={}).", HConstants.CLUSTER_DISTRIBUTED, false); + fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, false); + } return fs; }