You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2025/02/01 06:37:20 UTC

Change in asterixdb[master]: WIP: No Local Recovery when no checkpoint

From Ritik Raj <ra...@gmail.com>:

Ritik Raj has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19384 )


Change subject: WIP: No Local Recovery when no checkpoint
......................................................................

WIP: No Local Recovery when no checkpoint

since there is no checkpoint, there is no logs to replay.
hence skipping redo.

Change-Id: I0cfb18976a0b0860b6dffc0c916a68e358ac00ef
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java
1 file changed, 24 insertions(+), 8 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/84/19384/1

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 77a1e01..f852425 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
@@ -158,17 +158,21 @@
     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();
 
-        //get active partitions on this node
-        replayPartitionsLogs(partitions, logMgr.getLogReader(true), lowWaterMarkLSN, true);
+        Checkpoint checkpointObject = checkpointManager.getLatest();
+        if (checkpointObject != null) {
+            long readableSmallestLSN = logMgr.getReadableSmallestLSN();
+            long lowWaterMarkLSN = checkpointObject.getMinMCTFirstLsn();
+            if (lowWaterMarkLSN < readableSmallestLSN) {
+                lowWaterMarkLSN = readableSmallestLSN;
+            }
+
+            //get active partitions on this node
+            replayPartitionsLogs(partitions, logMgr.getLogReader(true), lowWaterMarkLSN, true);
+        }
+
     }
 
     public synchronized void replayPartitionsLogs(Set<Integer> partitions, ILogReader logReader, long lowWaterMarkLSN,

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19384
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I0cfb18976a0b0860b6dffc0c916a68e358ac00ef
Gerrit-Change-Number: 19384
Gerrit-PatchSet: 1
Gerrit-Owner: Ritik Raj <ra...@gmail.com>
Gerrit-MessageType: newchange