This is an automated email from the ASF dual-hosted git repository.

mhubail pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e7f6f72  [NO ISSUE][REP] Extensible Recovery Cleanup
e7f6f72 is described below

commit e7f6f72a480ed09d879e540a325825a61d55fae0
Author: Murtadha Hubail <murtadha.hub...@couchbase.com>
AuthorDate: Thu Aug 26 02:15:07 2021 +0300

    [NO ISSUE][REP] Extensible Recovery Cleanup
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    - Extensible recovery cleanup after replaying replica
      partitions log.
    
    Change-Id: I57aa7e17026148d2e8d3307a2b82ef4dbc93b910
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12984
    Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Murtadha Hubail <mhub...@apache.org>
    Reviewed-by: Ali Alsuliman <ali.al.solai...@gmail.com>
---
 .../src/main/java/org/apache/asterix/app/nc/RecoveryManager.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
index ffde7d0..4f5a9f8 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
@@ -161,14 +161,12 @@ public class RecoveryManager implements IRecoveryManager, 
ILifeCycleComponent {
     public void startLocalRecovery(Set<Integer> partitions) throws 
IOException, ACIDException {
         state = SystemState.RECOVERING;
         LOGGER.info("starting recovery for partitions {}", partitions);
-
         long readableSmallestLSN = logMgr.getReadableSmallestLSN();
         Checkpoint checkpointObject = checkpointManager.getLatest();
         long lowWaterMarkLSN = checkpointObject.getMinMCTFirstLsn();
         if (lowWaterMarkLSN < readableSmallestLSN) {
             lowWaterMarkLSN = readableSmallestLSN;
         }
-
         //delete any recovery files from previous failed recovery attempts
         deleteRecoveryTemporaryFiles();
 
@@ -538,6 +536,7 @@ public class RecoveryManager implements IRecoveryManager, 
ILifeCycleComponent {
             if (flush) {
                 appCtx.getDatasetLifecycleManager().flushAllDatasets();
             }
+            cleanUp(partitions);
         } catch (IOException | ACIDException e) {
             throw HyracksDataException.create(e);
         } finally {
@@ -571,6 +570,10 @@ public class RecoveryManager implements IRecoveryManager, 
ILifeCycleComponent {
         FileUtils.deleteQuietly(recoveryFolderPath.toFile());
     }
 
+    protected void cleanUp(Set<Integer> partitions) throws 
HyracksDataException {
+        // the cleanup is currently done by 
PersistentLocalResourceRepository#clean
+    }
+
     private String getRecoveryDirPath() {
         String logDir = logMgr.getLogManagerProperties().getLogDir();
         if (!logDir.endsWith(File.separator)) {

Reply via email to