chungen0126 commented on code in PR #7430:
URL: https://github.com/apache/ozone/pull/7430#discussion_r1841557278
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineReportHandler.java:
##########
@@ -91,35 +92,45 @@ public void onMessage(PipelineReportFromDatanode
pipelineReportFromDatanode,
for (PipelineReport report : pipelineReport.getPipelineReportList()) {
try {
processPipelineReport(report, dn, publisher);
- } catch (NotLeaderException ex) {
- // Avoid NotLeaderException logging which happens when processing
- // pipeline report on followers.
} catch (PipelineNotFoundException e) {
- LOGGER.error("Could not find pipeline {}", report.getPipelineID());
+ handlePipelineNotFoundException(report, dn, publisher);
} catch (IOException | TimeoutException e) {
- LOGGER.error("Could not process pipeline report={} from dn={}.",
- report, dn, e);
+ // Ignore NotLeaderException logging which happens when processing
+ // pipeline report on followers.
+ if (!isNotLeaderException(e)) {
+ LOGGER.error("Could not process pipeline report={} from dn={}.",
+ report, dn, e);
+ }
}
}
}
- protected void processPipelineReport(PipelineReport report,
- DatanodeDetails dn, EventPublisher publisher)
- throws IOException, TimeoutException {
- PipelineID pipelineID = PipelineID.getFromProtobuf(report.getPipelineID());
- Pipeline pipeline;
- try {
- pipeline = pipelineManager.getPipeline(pipelineID);
- } catch (PipelineNotFoundException e) {
- if (scmContext.isLeader()) {
- LOGGER.info("Reported pipeline {} is not found", pipelineID);
- SCMCommand< ? > command = new ClosePipelineCommand(pipelineID);
+ private void handlePipelineNotFoundException(final PipelineReport report,
+ final DatanodeDetails dn, final EventPublisher publisher) {
+ final PipelineID pipelineID =
PipelineID.getFromProtobuf(report.getPipelineID());
+ LOGGER.error("Pipeline {}, reported by datanode {} is not found.",
pipelineID, dn);
Review Comment:
I think it would be better to log the message as info. As this is just
normal operation in Ozone.
```suggestion
LOGGER.info("Pipeline {}, reported by datanode {} is not found.",
pipelineID, dn);
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]