prashantpogde commented on code in PR #4553:
URL: https://github.com/apache/ozone/pull/4553#discussion_r1176899847


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -161,17 +163,23 @@ public class RocksDBCheckpointDiffer implements 
AutoCloseable {
   private long reconstructionSnapshotGeneration;
   private String reconstructionLastSnapshotID;
 
-  /**
-   * Dummy object that acts as a write lock in compaction listener.
-   */
-  private final Object compactionListenerWriteLock = new Object();
-
   private final ScheduledExecutorService executor;
   private boolean closed;
   private final long maxAllowedTimeInDag;
 
   private ColumnFamilyHandle snapshotInfoTableCFHandle;
 
+  /**
+   * Dummy object that acts as a read and write lock to achieve synchronization
+   * between update to compaction DAG and snapDiff jobs.
+   * Dummy object is used instead of an actual {@link ReadWriteLock} to keep it
+   * simple since all the processes using compaction DAG are background jobs.
+   * They are either RocksDB compaction listener (to add new compaction entries
+   * to DAG), compaction DAG pruning job (to removes older snapshot's from DAG)
+   * or a snap diff job (reads compaction DAG).
+   */
+  private final Object compactionDagLock = new Object();

Review Comment:
   We should make RocksDBCheckpointDiffer a singleton class otherwise this 
could still be a problem with future changes.



-- 
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]

Reply via email to