hemantk-12 commented on code in PR #5035:
URL: https://github.com/apache/ozone/pull/5035#discussion_r1258811904


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3577,18 +3578,24 @@ public List<OzoneAcl> getAcl(OzoneObj obj) throws 
IOException {
    * @return If checkpoint is installed successfully, return the
    *         corresponding termIndex. Otherwise, return null.
    */
-  public TermIndex installSnapshotFromLeader(String leaderId) {
+  public synchronized TermIndex installSnapshotFromLeader(String leaderId) {
     if (omRatisSnapshotProvider == null) {
       LOG.error("OM Snapshot Provider is not configured as there are no peer " 
+
           "nodes.");
       return null;
     }
 
+    java.util.Optional<SstFilteringService> sstFilteringService =
+        java.util.Optional.ofNullable(
+            keyManager.getSnapshotSstFilteringService());
     DBCheckpoint omDBCheckpoint;
+    sstFilteringService.ifPresent(BackgroundService::shutdown);

Review Comment:
   Had an offline discussion with Swami and Prashant. Race condition Swami is 
trying to solve here is when follower requests leader for tarball (incremental 
diff) with excluded SST files list based on current state of the follower, 
leader will only send the diff SST files and new manifest file. In meanwhile 
SST Filtering service might delete irrelevant SST files. Follower loads DB 
based on new manifest from leader and  when it does that some files might not 
existed on follower because SST Filtering service has removed them in between 
fetching and loading. This leaves DB (manifest and data) into inconsistent 
state. Because manifest contains SST files which actual doesn't exist on 
follower.
   
   I hope this help @GeorgeJahad.
   
   @swamirishi added some details here: 
https://github.com/apache/ozone/pull/5035/#issuecomment-1629504655 
   
   



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3577,18 +3578,24 @@ public List<OzoneAcl> getAcl(OzoneObj obj) throws 
IOException {
    * @return If checkpoint is installed successfully, return the
    *         corresponding termIndex. Otherwise, return null.
    */
-  public TermIndex installSnapshotFromLeader(String leaderId) {
+  public synchronized TermIndex installSnapshotFromLeader(String leaderId) {
     if (omRatisSnapshotProvider == null) {
       LOG.error("OM Snapshot Provider is not configured as there are no peer " 
+
           "nodes.");
       return null;
     }
 
+    java.util.Optional<SstFilteringService> sstFilteringService =
+        java.util.Optional.ofNullable(
+            keyManager.getSnapshotSstFilteringService());
     DBCheckpoint omDBCheckpoint;
+    sstFilteringService.ifPresent(BackgroundService::shutdown);

Review Comment:
   Had an offline discussion with Swami and Prashant. Race condition Swami is 
trying to solve here is when follower requests leader for tarball (incremental 
diff) with excluded SST files list based on current state of the follower, 
leader will only send the diff SST files and new manifest file. In meanwhile 
SST Filtering service might delete irrelevant SST files. Follower loads DB 
based on new manifest from leader and  when it does that some files might not 
existed on follower because SST Filtering service has removed them in between 
fetching and loading. This leaves DB (manifest and data) into inconsistent 
state. Because manifest contains SST files which actual doesn't exist on 
follower.
   
   I hope this help @GeorgeJahad.
   
   @swamirishi added more details here: 
https://github.com/apache/ozone/pull/5035/#issuecomment-1629504655 
   
   



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