HDDS-1748. Error message for 3 way commit failure is not verbose. Contributed by Supratim Deka (#1051)

This commit is contained in:
supratimdeka 2019-07-10 16:45:55 +05:30 committed by Mukul Kumar Singh
parent 993dc8726b
commit e0fa1040af
2 changed files with 8 additions and 6 deletions

View File

@ -259,7 +259,7 @@ public XceiverClientReply watchForCommit(long index, long timeout)
replyFuture.get(timeout, TimeUnit.MILLISECONDS); replyFuture.get(timeout, TimeUnit.MILLISECONDS);
} catch (Exception e) { } catch (Exception e) {
Throwable t = HddsClientUtils.checkForException(e); Throwable t = HddsClientUtils.checkForException(e);
LOG.warn("3 way commit failed ", e); LOG.warn("3 way commit failed on pipeline {}", pipeline, e);
if (t instanceof GroupMismatchException) { if (t instanceof GroupMismatchException) {
throw e; throw e;
} }
@ -278,8 +278,9 @@ public XceiverClientReply watchForCommit(long index, long timeout)
// replication. // replication.
commitInfoMap.remove(address); commitInfoMap.remove(address);
LOG.info( LOG.info(
"Could not commit " + index + " to all the nodes. Server " + address "Could not commit index {} on pipeline {} to all the nodes. " +
+ " has failed." + " Committed by majority."); "Server {} has failed. Committed by majority.",
index, pipeline, address);
}); });
} }
clientReply.setLogIndex(index); clientReply.setLogIndex(index);

View File

@ -356,9 +356,10 @@ private void watchForCommit(boolean bufferFull) throws IOException {
if (reply != null) { if (reply != null) {
List<DatanodeDetails> dnList = reply.getDatanodes(); List<DatanodeDetails> dnList = reply.getDatanodes();
if (!dnList.isEmpty()) { if (!dnList.isEmpty()) {
if (failedServers.isEmpty()) { Pipeline pipe = xceiverClient.getPipeline();
failedServers = new ArrayList<>();
} LOG.warn("Failed to commit BlockId {} on {}. Failed nodes: {}",
blockID, pipe, dnList);
failedServers.addAll(dnList); failedServers.addAll(dnList);
} }
} }