smengcl commented on code in PR #11296:
URL: https://github.com/apache/ozone/pull/11296#discussion_r4211808388
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -165,17 +169,19 @@ public class SnapshotDiffManager implements
AutoCloseable, SnapshotDiffManagerMX
private static final Logger LOG =
LoggerFactory.getLogger(SnapshotDiffManager.class);
private static final Map<DiffType, String> DIFF_TYPE_STRING_MAP =
- new EnumMap<>(ImmutableMap.of(DELETE, "1", RENAME, "2", CREATE, "3",
MODIFY, "4"));
+ new EnumMap<>(ImmutableMap.of(DELETE, "1", MODIFY, "2", RENAME, "3",
CREATE, "4"));
Review Comment:
Agreed that `DiffType` comes from the stored value, so completed reports
remain readable. The remaining concern is interrupted jobs restarted across an
upgrade.
`loadJobsOnStartUp()` resubmits `IN_PROGRESS` jobs with the same job ID,
without clearing their partial report rows. For example:
1. The old version writes a CREATE entry under prefix `3`.
2. OM restarts with this change and regenerates the job.
3. The same CREATE is now written under prefix `4`, leaving the old row
intact.
4. Reading the report returns both CREATE entries.
This can be reproduced by seeding an old-format CREATE row, then calling
`generateDiffReport()` with the same job ID: generation reports one entry, but
reading the report returns two.
Could we preserve the existing mapping, or clear the partial report before
regenerating a restarted job? A full format migration may not be necessary, but
this restart case needs 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: [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]