[
https://issues.apache.org/jira/browse/HBASE-26680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaolin Ha updated HBASE-26680:
-------------------------------
Description:
{code:java}
public static AsyncWriter createAsyncWriter(Configuration conf, FileSystem fs,
Path path,
boolean overwritable, long blocksize, EventLoopGroup eventLoopGroup,
Class<? extends Channel> channelClass, StreamSlowMonitor monitor) throws
IOException {
// Configuration already does caching for the Class lookup.
Class<? extends AsyncWriter> logWriterClass = conf.getClass(
WRITER_IMPL, AsyncProtobufLogWriter.class, AsyncWriter.class);
try {
AsyncWriter writer = logWriterClass.getConstructor(EventLoopGroup.class,
Class.class)
.newInstance(eventLoopGroup, channelClass);
writer.init(fs, path, conf, overwritable, blocksize, monitor);
return writer;
} catch (Exception e) {
if (e instanceof CommonFSUtils.StreamLacksCapabilityException) {
LOG.error("The RegionServer async write ahead log provider " +
"relies on the ability to call " + e.getMessage() + " for proper
operation during " +
"component failures, but the current FileSystem does not support doing
so. Please " +
"check the config value of '" + CommonFSUtils.HBASE_WAL_DIR + "' and
ensure " +
"it points to a FileSystem mount that has suitable capabilities for
output streams.");
} else {
LOG.debug("Error instantiating log writer.", e);
}
Throwables.propagateIfPossible(e, IOException.class);
throw new IOException("cannot get log writer", e);
}
} {code}
I think writer should be closed when encounters init exception here.
This can reduce the recoverLease time before log split, and will reduce side
effects after HBASE-26552.
Broken writers need to be closed, so that when doing log split, there will be
no need to recover lease for those length 0 wals.
was:
{code:java}
public static AsyncWriter createAsyncWriter(Configuration conf, FileSystem fs,
Path path,
boolean overwritable, long blocksize, EventLoopGroup eventLoopGroup,
Class<? extends Channel> channelClass, StreamSlowMonitor monitor) throws
IOException {
// Configuration already does caching for the Class lookup.
Class<? extends AsyncWriter> logWriterClass = conf.getClass(
WRITER_IMPL, AsyncProtobufLogWriter.class, AsyncWriter.class);
try {
AsyncWriter writer = logWriterClass.getConstructor(EventLoopGroup.class,
Class.class)
.newInstance(eventLoopGroup, channelClass);
writer.init(fs, path, conf, overwritable, blocksize, monitor);
return writer;
} catch (Exception e) {
if (e instanceof CommonFSUtils.StreamLacksCapabilityException) {
LOG.error("The RegionServer async write ahead log provider " +
"relies on the ability to call " + e.getMessage() + " for proper
operation during " +
"component failures, but the current FileSystem does not support doing
so. Please " +
"check the config value of '" + CommonFSUtils.HBASE_WAL_DIR + "' and
ensure " +
"it points to a FileSystem mount that has suitable capabilities for
output streams.");
} else {
LOG.debug("Error instantiating log writer.", e);
}
Throwables.propagateIfPossible(e, IOException.class);
throw new IOException("cannot get log writer", e);
}
} {code}
I think writer should be closed when encounters init exception here.
This can reduce the recoverLease time before log split, and will reduce side
effects after HBASE-26552.
> Close the broken writer in AsyncFSWALProvider#createAsyncWriter
> ---------------------------------------------------------------
>
> Key: HBASE-26680
> URL: https://issues.apache.org/jira/browse/HBASE-26680
> Project: HBase
> Issue Type: Improvement
> Components: wal
> Affects Versions: 3.0.0-alpha-1, 2.0.0
> Reporter: Xiaolin Ha
> Assignee: Xiaolin Ha
> Priority: Major
> Fix For: 2.5.0, 2.6.0, 3.0.0-alpha-3, 2.4.11
>
>
> {code:java}
> public static AsyncWriter createAsyncWriter(Configuration conf, FileSystem
> fs, Path path,
> boolean overwritable, long blocksize, EventLoopGroup eventLoopGroup,
> Class<? extends Channel> channelClass, StreamSlowMonitor monitor) throws
> IOException {
> // Configuration already does caching for the Class lookup.
> Class<? extends AsyncWriter> logWriterClass = conf.getClass(
> WRITER_IMPL, AsyncProtobufLogWriter.class, AsyncWriter.class);
> try {
> AsyncWriter writer = logWriterClass.getConstructor(EventLoopGroup.class,
> Class.class)
> .newInstance(eventLoopGroup, channelClass);
> writer.init(fs, path, conf, overwritable, blocksize, monitor);
> return writer;
> } catch (Exception e) {
> if (e instanceof CommonFSUtils.StreamLacksCapabilityException) {
> LOG.error("The RegionServer async write ahead log provider " +
> "relies on the ability to call " + e.getMessage() + " for proper
> operation during " +
> "component failures, but the current FileSystem does not support
> doing so. Please " +
> "check the config value of '" + CommonFSUtils.HBASE_WAL_DIR + "' and
> ensure " +
> "it points to a FileSystem mount that has suitable capabilities for
> output streams.");
> } else {
> LOG.debug("Error instantiating log writer.", e);
> }
> Throwables.propagateIfPossible(e, IOException.class);
> throw new IOException("cannot get log writer", e);
> }
> } {code}
> I think writer should be closed when encounters init exception here.
> This can reduce the recoverLease time before log split, and will reduce side
> effects after HBASE-26552.
> Broken writers need to be closed, so that when doing log split, there will be
> no need to recover lease for those length 0 wals.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)