hemantk-12 commented on code in PR #4553:
URL: https://github.com/apache/ozone/pull/4553#discussion_r1178510795
##########
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:
After changing RocksDBCheckpointDiffer to simply singleton, most of OM unit
and integration tests failed because each test is creating a new instance of
OmMetadataManagerImpl which initializes RBDStore and RocksDBCheckpointDiffer. I
tired to fix the tests by creating only one instance of OmMetadataManagerImpl
per test class but that doesn’t work either. Assertions are failing in the case.
https://github.com/hemantk-12/ozone/actions/runs/4813598710/jobs/8570328203
One way to fix this, is to have one instance of per RocksDBCheckpointDiffer
RocksDB dir and keep it in memory. Which solves the unit test failure and is
close to what we want achieve. I made the changes accordingly.
--
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]