HDFS-14785. [SBN read] Change client logging to be less aggressive. Contributed by Chen Liang.
This commit is contained in:
parent
f4f210d2e5
commit
2d7b37ea2b
|
@ -280,8 +280,10 @@ public class ObserverReadProxyProvider<T extends ClientProtocol>
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ioe = e;
|
ioe = e;
|
||||||
}
|
}
|
||||||
LOG.info("Failed to connect to {}. Assuming Standby state",
|
if (LOG.isDebugEnabled()) {
|
||||||
proxyInfo.getAddress(), ioe);
|
LOG.debug("Failed to connect to {} while fetching HAServiceState",
|
||||||
|
proxyInfo.getAddress(), ioe);
|
||||||
|
}
|
||||||
return HAServiceState.STANDBY;
|
return HAServiceState.STANDBY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,10 +415,21 @@ public class ObserverReadProxyProvider<T extends ClientProtocol>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get here, it means all observers have failed.
|
// Only log message if there are actual observer failures.
|
||||||
LOG.warn("{} observers have failed for read request {}; also found " +
|
// Getting here with failedObserverCount = 0 could
|
||||||
"{} standby and {} active. Falling back to active.",
|
// be that there is simply no Observer node running at all.
|
||||||
failedObserverCount, method.getName(), standbyCount, activeCount);
|
if (failedObserverCount > 0) {
|
||||||
|
// If we get here, it means all observers have failed.
|
||||||
|
LOG.warn("{} observers have failed for read request {}; "
|
||||||
|
+ "also found {} standby, {} active. "
|
||||||
|
+ "Falling back to active.", failedObserverCount,
|
||||||
|
method.getName(), standbyCount, activeCount);
|
||||||
|
} else {
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Read falling back to active without observer read "
|
||||||
|
+ "fail, is there no observer node running?");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either all observers have failed, or that it is a write request.
|
// Either all observers have failed, or that it is a write request.
|
||||||
|
|
Loading…
Reference in New Issue