swamirishi commented on code in PR #8214: URL: https://github.com/apache/ozone/pull/8214#discussion_r2032412038
########## hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java: ########## @@ -163,6 +178,8 @@ public class RocksDBCheckpointDiffer implements AutoCloseable, private final long maxAllowedTimeInDag; private final BootstrapStateHandler.Lock lock = new BootstrapStateHandler.Lock(); + private final Striped<ReadWriteLock> stripedSSTLock; Review Comment: Use IOzoneManagerLock directly. Add a resource SST_FILE_LOCK https://github.com/apache/ozone/blob/0f52a34d0c45f5f17a568ea0d183880dfcdcd063/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java#L571 https://github.com/apache/ozone/blob/6cce2bb5d2f8bd6b6f54362fcb256ffc5c1b2e2a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java#L924-L927 ########## hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java: ########## @@ -843,9 +872,15 @@ public synchronized Optional<List<String>> getSSTDiffListWithFullPath(DifferSnap String sstFullPath = getSSTFullPath(sst, src.getDbPath(), dest.getDbPath()); Path link = Paths.get(sstFilesDirForSnapDiffJob, sst + SST_FILE_EXTENSION); - Path srcFile = Paths.get(sstFullPath); - createLink(link, srcFile); - return link.toString(); + // Take a read lock on the SST FILE + getSSTFileLock(link.toFile().getAbsolutePath()).readLock().lock(); Review Comment: Lock needs to be taken on the sst file name or InodeId of the file ########## hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java: ########## @@ -217,6 +234,13 @@ public class RocksDBCheckpointDiffer implements AutoCloseable, TimeUnit.MILLISECONDS); this.suspended = new AtomicBoolean(false); + this.stripedSSTLock = SimpleStriped.readWriteLock( Review Comment: Let us not do add a new configuration for locks, reuse OzoneManagerLock -- 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-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org