Apache-HBase commented on a change in pull request #205: HBASE-20902 when WAL
sync failed, we should bypass the failed DN that previously used
URL: https://github.com/apache/hbase/pull/205#discussion_r279702718
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputHelper.java
##########
@@ -751,6 +752,24 @@ private static FanOutOneBlockAsyncDFSOutput
createOutput(DistributedFileSystem d
int createMaxRetries = conf.getInt(ASYNC_DFS_OUTPUT_CREATE_MAX_RETRIES,
DEFAULT_ASYNC_DFS_OUTPUT_CREATE_MAX_RETRIES);
DatanodeInfo[] excludesNodes = EMPTY_DN_ARRAY;
+ if (oldPath != null) {
+ String oldPathStr = oldPath.toUri().getPath();
+ long len = namenode.getFileInfo(oldPathStr).getLen();
+ for(LocatedBlock block : namenode.getBlockLocations(oldPathStr,
Math.max(0, len - 1), len)
+ .getLocatedBlocks()) {
+ for(DatanodeInfo dn : block.getLocations()) {
+ excludesNodes = ArrayUtils.add(excludesNodes, dn);
+ }
+ }
+ if (LOG.isDebugEnabled()) {
+ StringBuilder sb = new StringBuilder("create new output because old
wal sync failed, old path is: ");
+ sb.append(oldPathStr).append(", newPath excludesNodes are :");
+ for(DatanodeInfo info : excludesNodes) {
+ sb.append(info.getInfoAddr()).append(";");
+ }
+ LOG.debug(sb.toString());
Review comment:
whitespace:tabs in line
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services