prashantpogde commented on code in PR #4438:
URL: https://github.com/apache/ozone/pull/4438#discussion_r1149788226
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -120,18 +144,32 @@ public SnapshotDiffManager(ManagedRocksDB db,
// DiffReportEntry codec for Diff Report.
this.codecRegistry.addCodec(DiffReportEntry.class,
new OmDBDiffReportEntryCodec());
+ this.codecRegistry.addCodec(SnapshotDiffJob.class,
+ new SnapshotDiffJobCodec());
this.snapDiffJobTable = new RocksDbPersistentMap<>(db,
snapDiffJobCfh,
codecRegistry,
String.class,
- String.class);
+ SnapshotDiffJob.class);
this.snapDiffReportTable = new RocksDbPersistentMap<>(db,
snapDiffReportCfh,
codecRegistry,
byte[].class,
byte[].class);
+
+ this.executorService = new ThreadPoolExecutor(DEFAULT_THREAD_POOL_SIZE,
+ DEFAULT_THREAD_POOL_SIZE,
+ 0,
+ TimeUnit.SECONDS,
+ new ArrayBlockingQueue<>(DEFAULT_THREAD_POOL_SIZE),
+ new ThreadPoolExecutor.CallerRunsPolicy()
+ );
+
+ // TODO: [SNAPSHOT] Load jobs only if it is leader node.
Review Comment:
I have been thinking about this. It is not harmful to take a pending
Snapdiff Job to completion if the OM node losts the leadership. However it
would be inefficient. However it is very difficult to make this efficient if
the leader change happens more often. I guess it is OK to let the SnapdiffJob
run on more than one OM node e.g. current leader and a previous leader node. I
believe, eventually we need to build the HA awareness for Snapdiff job. If a
follower node has the Snapdiff, we just ask the client to get the Snapdiff from
that OM node directly. A leader/follower status doesn't matter for Snapdiff
job. It may be ok to leave a detailed comment here.
--
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]