peterxcli commented on code in PR #11321:
URL: https://github.com/apache/ozone/pull/11321#discussion_r4111710220
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -1744,10 +1744,17 @@ private synchronized void
updateJobStatusToFailed(String jobKey,
snapDiffJobTable.put(jobKey, snapshotDiffJob);
}
- private synchronized void updateJobStatusToDone(String jobKey,
- long totalDiffEntries,
- String largestJobKey) {
+ synchronized void updateJobStatusToDone(String jobKey,
+ String jobId,
+ long totalDiffEntries,
+ String largestJobKey) {
SnapshotDiffJob snapshotDiffJob = snapDiffJobTable.get(jobKey);
+ // A cancelled job's task keeps running, and a resubmit reuses the jobKey
with a new jobId.
+ if (!snapshotDiffJob.getJobId().equals(jobId)) {
+ LOG.warn("Not marking snapshot diff job {} as DONE: task jobId {} was
superseded by jobId {}.",
+ jobKey, jobId, snapshotDiffJob.getJobId());
+ return;
+ }
Review Comment:
I see, so there would be only one job id for a job key in `snapDiffJobTable`
at any moment.
--
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]