swamirishi commented on code in PR #9129:
URL: https://github.com/apache/ozone/pull/9129#discussion_r2478417659
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -253,23 +254,32 @@ public void writeDbDataToStream(HttpServletRequest
request, OutputStream destina
if (shouldContinue) {
// we finished transferring files from snapshot DB's by now and
// this is the last step where we transfer the active om.db contents
- // get the list of sst files of the checkpoint.
- checkpoint = createAndPrepareCheckpoint(true);
- List<Path> sstBackupFiles =
extractSSTFilesFromCompactionLog(checkpoint);
- // unlimited files as we want the Active DB contents to be transferred
in a single batch
- maxTotalSstSize.set(Long.MAX_VALUE);
- Path checkpointDir = checkpoint.getCheckpointLocation();
Map<String, String> hardLinkFileMap = new HashMap<>();
- writeDBToArchive(sstFilesToExclude, checkpointDir,
- maxTotalSstSize, archiveOutputStream, tmpdir, hardLinkFileMap,
false);
- if (includeSnapshotData) {
- writeDBToArchive(sstFilesToExclude, getCompactionLogDir(),
maxTotalSstSize, archiveOutputStream, tmpdir,
+ SnapshotCache snapshotCache =
om.getOmSnapshotManager().getSnapshotCache();
+ /*
+ * When includeSnapshotData is false, lock is set to null and no
locking is performed.
Review Comment:
@sadanand48 Can you add a comment also explaining
[here](https://github.com/apache/ozone/blob/f30870f2a229a2a618f3199aa047d3397e77a9cd/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotPurgeResponse.java#L123)
about the race condition with the bootstrap flow and how this lock is
absolutely necessary during bootstrap.
Also please add a unit test for such race conditions
--
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]