You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sumitagrawl (via GitHub)" <gi...@apache.org> on 2025/02/07 05:33:33 UTC
Re: [PR] HDDS-12062. Recon - Error handling in NSSummaryTask to avoid data inconsistencies. [ozone]
sumitagrawl commented on code in PR #7723:
URL: https://github.com/apache/ozone/pull/7723#discussion_r1945969200
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java:
##########
@@ -210,21 +211,22 @@ protected void handleDeleteDirEvent(OmDirectoryInfo directoryInfo,
protected boolean flushAndCommitNSToDB(Map<Long, NSSummary> nsSummaryMap) {
try {
writeNSSummariesToDB(nsSummaryMap);
- nsSummaryMap.clear();
} catch (IOException e) {
LOG.error("Unable to write Namespace Summary data in Recon DB.", e);
return false;
+ } finally {
+ nsSummaryMap.clear();
}
return true;
}
- protected boolean checkAndCallFlushToDB(
+/* protected boolean checkAndCallFlushToDB(
Review Comment:
avoid code commenting, remove if not requied
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTask.java:
##########
@@ -99,27 +104,28 @@ public String getTaskName() {
}
@Override
- public Pair<String, Boolean> process(OMUpdateEventBatch events) {
- long startTime = System.currentTimeMillis();
- boolean success = nsSummaryTaskWithFSO.processWithFSO(events);
- if (!success) {
+ public Pair<String, Pair<Integer, Boolean>> process(
+ OMUpdateEventBatch events, int seekPosition) {
+ Pair<Integer, Boolean> itrPosStatusPair =
+ nsSummaryTaskWithFSO.processWithFSO(events, seekPosition);
+ if (!itrPosStatusPair.getRight()) {
LOG.error("processWithFSO failed.");
}
- success = nsSummaryTaskWithLegacy.processWithLegacy(events);
- if (!success) {
+ itrPosStatusPair =
+ nsSummaryTaskWithLegacy.processWithLegacy(events, seekPosition);
+ if (!itrPosStatusPair.getRight()) {
LOG.error("processWithLegacy failed.");
}
- success = nsSummaryTaskWithOBS.processWithOBS(events);
- if (!success) {
+ itrPosStatusPair =
+ nsSummaryTaskWithOBS.processWithOBS(events, seekPosition);
+ if (!itrPosStatusPair.getRight()) {
LOG.error("processWithOBS failed.");
}
- LOG.debug("{} successfully processed in {} milliseconds",
- getTaskName(), (System.currentTimeMillis() - startTime));
- return new ImmutablePair<>(getTaskName(), success);
+ return new ImmutablePair<>(getTaskName(), itrPosStatusPair);
Review Comment:
The previous failure is ignored and last itrPosStatusPair is returned, recheck if any concern in this failure handling.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org