Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11501. Improve logging in XceiverServerRatis #7252

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ private static Parameters createTlsParameters(SecurityConfig conf,
@Override
public void start() throws IOException {
if (!isStarted) {
LOG.info("Starting {} {}", getClass().getSimpleName(), server.getId());
LOG.info("Starting {} raftPeerId : {}", getClass().getSimpleName(), server.getId());
for (ThreadPoolExecutor executor : chunkExecutors) {
executor.prestartAllCoreThreads();
}
Expand All @@ -584,7 +584,7 @@ public void start() throws IOException {
private int getRealPort(InetSocketAddress address, Port.Name name) {
int realPort = address.getPort();
datanodeDetails.setPort(DatanodeDetails.newPort(name, realPort));
LOG.info("{} {} is started using port {} for {}",
LOG.info("{} raftPeerId : {} is started using port {} for {}",
getClass().getSimpleName(), server.getId(), realPort, name);
return realPort;
}
Expand All @@ -593,7 +593,7 @@ private int getRealPort(InetSocketAddress address, Port.Name name) {
public void stop() {
if (isStarted) {
try {
LOG.info("Stopping {} {}", getClass().getSimpleName(), server.getId());
LOG.info("Stopping {} raftPeerId : {}", getClass().getSimpleName(), server.getId());
// shutdown server before the executors as while shutting down,
// some of the tasks would be executed using the executors.
server.close();
Expand All @@ -602,7 +602,8 @@ public void stop() {
}
isStarted = false;
} catch (IOException e) {
LOG.error("XceiverServerRatis Could not be stopped gracefully.", e);
LOG.error("{} raftPeerId : {} Could not be stopped gracefully.",
getClass().getSimpleName(), server.getId(), e);
}
}
}
Expand Down Expand Up @@ -713,11 +714,11 @@ private void handlePipelineFailure(RaftGroupId groupId,
RaftPeerId id = RaftPeerId.valueOf(roleInfoProto.getSelf().getId());
switch (roleInfoProto.getRole()) {
case CANDIDATE:
msg = datanode + " is in candidate state for " +
msg = "Server(DatanodeId=" + datanode + ") is in candidate state for " +
roleInfoProto.getCandidateInfo().getLastLeaderElapsedTimeMs() + "ms";
break;
case FOLLOWER:
msg = datanode + " closes pipeline when installSnapshot from leader " +
msg = "Server(DatanodeId=" + datanode + ") closes pipeline when installSnapshot from leader " +
"because leader snapshot doesn't contain any data to replay, " +
"all the log entries prior to the snapshot might have been purged." +
"So follower should not try to install snapshot from leader but" +
Expand All @@ -726,11 +727,11 @@ private void handlePipelineFailure(RaftGroupId groupId,
break;
case LEADER:
StringBuilder sb = new StringBuilder();
sb.append(datanode).append(" has not seen follower/s");
sb.append("Server(DatanodeId=" + datanode + ")").append(" has not seen follower/s. Slowness follower:");
for (RaftProtos.ServerRpcProto follower : roleInfoProto.getLeaderInfo()
.getFollowerInfoList()) {
if (follower.getLastRpcElapsedTimeMs() > nodeFailureTimeoutMs) {
sb.append(" ").append(RatisHelper.toDatanodeId(follower.getId()))
sb.append(" ").append("Server(DatanodeId=" + RatisHelper.toDatanodeId(follower.getId()) + ")")
.append(" for ").append(follower.getLastRpcElapsedTimeMs())
.append("ms");
}
Expand Down