arp7 commented on a change in pull request #1129:
URL: https://github.com/apache/hadoop-ozone/pull/1129#discussion_r455433582
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -249,6 +252,20 @@ public void start(OzoneConfiguration configuration) throws
IOException {
if (store == null) {
File metaDir = OMStorage.getOmDbDir(configuration);
+ // Check if there is a DB Inconsistent Marker in the metaDir. This
+ // marker indicates that the DB is in an inconsistent state and hence
+ // the OM process should be terminated.
+ File markerFile = new File(metaDir, DB_TRANSIENT_MARKER);
+ if (Files.exists(markerFile.toPath())) {
Review comment:
Nitpick: why not just `markerFile.exists()`?
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OzoneManagerSnapshotProvider.java
##########
@@ -113,8 +113,10 @@ public
OzoneManagerSnapshotProvider(MutableConfigurationSource conf,
public DBCheckpoint getOzoneManagerDBSnapshot(String leaderOMNodeID)
throws IOException {
String snapshotTime = Long.toString(System.currentTimeMillis());
- String snapshotFileName = Paths.get(omSnapshotDir.getAbsolutePath(),
- snapshotTime, OM_DB_NAME).toFile().getAbsolutePath();
+ String snapshotFileName = OM_DB_NAME + "-" + leaderOMNodeID
Review comment:
Did we change the snapshot file name convention in this jira?
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -228,15 +228,34 @@ public static Status
exceptionToResponseStatus(IOException exception) {
}
/**
- * Obtain Transaction info from downloaded snapshot DB.
+ * Obtain OMTransactionInfo from Checkpoint.
+ */
+ public static OMTransactionInfo getTrxnInfoFromCheckpoint(
+ OzoneConfiguration conf, Path dbPath) throws Exception {
+ Path dbDir = dbPath.getParent();
+ String dbName = dbPath.getFileName().toString();
+ if (dbDir == null) {
+ throw new IOException("Checkpoint {} does not have proper DB location");
Review comment:
Print the `dbPath` in the exception message to make debugging easier in
case this happens.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]