[NO ISSUE][OBS] Log content of index dir with missing checkpoints
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- When an index is missing checkpoint file, it should contain
the mask and gets cleaned up on bootstrap. when that doesn't
happen, we should log the content of the dir to help investigating.
Change-Id: I1903a40e129f648d4a0f8be6e820c6d45c722bec
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2801
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
index c1a81a3..64d8e93 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/IndexCheckpointManager.java
@@ -27,6 +27,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
@@ -141,6 +142,8 @@
throw HyracksDataException.create(e);
}
if (checkpoints.isEmpty()) {
+ LOGGER.warn("Couldn't find any checkpoint file for index {}. Content of dir are {}.", indexPath,
+ Arrays.toString(indexPath.toFile().listFiles()));
throw new IllegalStateException("Couldn't find any checkpoints for resource: " + indexPath);
}
checkpoints.sort(Comparator.comparingLong(IndexCheckpoint::getId).reversed());