Skip to content

HDDS-9216. Update log in exception while processing ICR for container. #5226

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

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Changes from all commits
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 @@ -25,6 +25,7 @@
import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos
.ContainerReplicaProto;
import org.apache.hadoop.hdds.scm.container.report.ContainerReportValidator;
import org.apache.hadoop.hdds.scm.exceptions.SCMException;
import org.apache.hadoop.hdds.scm.ha.SCMContext;
import org.apache.hadoop.hdds.scm.node.NodeManager;
import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
Expand All @@ -33,7 +34,6 @@
import org.apache.hadoop.hdds.server.events.EventHandler;
import org.apache.hadoop.hdds.server.events.EventPublisher;
import org.apache.hadoop.ozone.common.statemachine.InvalidStateTransitionException;
import org.apache.ratis.protocol.exceptions.NotLeaderException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -108,9 +108,14 @@ public void onMessage(final IncrementalContainerReportFromDatanode report,
} catch (ContainerReplicaNotFoundException e) {
LOG.warn("Container {} replica not found!",
replicaProto.getContainerID());
} catch (NotLeaderException nle) {
LOG.warn("Failed to process " + replicaProto.getState()
+ " Container " + id + " due to " + nle);
} catch (SCMException ex) {
if (ex.getResult() == SCMException.ResultCodes.SCM_NOT_LEADER) {
LOG.warn("Failed to process {} container {}: {}",
replicaProto.getState(), id, ex.getMessage());
} else {
LOG.error("Exception while processing ICR for container {}",
replicaProto.getContainerID(), ex);
}
} catch (IOException | InvalidStateTransitionException |
TimeoutException e) {
LOG.error("Exception while processing ICR for container {}",
Expand Down