avijayanhwx commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r557927111
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerStarter.java
##########
@@ -99,29 +99,25 @@ public void initOm()
}
}
- // TODO: Convert this flag to bring the OM out of prepare mode with the new
- // bits when prepare marker files have been implemented.
-// /**
-// * This function implements a sub-command to allow the OM to be
-// * "prepared for upgrade".
-// */
-// @CommandLine.Command(name = "--prepareForUpgrade",
-// aliases = {"--prepareForDowngrade", "--flushTransactions"},
-// customSynopsis = "ozone om [global options] --prepareForUpgrade",
-// hidden = false,
-// description = "Prepare the OM for upgrade/downgrade. (Flush Raft log "
+
-// "transactions.)",
-// mixinStandardHelpOptions = true,
-// versionProvider = HddsVersionProvider.class)
-// @SuppressFBWarnings("DM_EXIT")
-// public void prepareOmForUpgrade() throws Exception {
-// commonInit();
-// boolean result = receiver.prepareForUpgrade(conf);
-// if (!result) {
-// throw new Exception("Prepare OM For Upgrade failed.");
-// }
-// System.exit(0);
-// }
+ /**
+ * This function implements a sub-command to allow the OM to be
+ * "prepared for upgrade".
Review comment:
Wrong Javadoc?
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerStarter.java
##########
@@ -99,29 +99,25 @@ public void initOm()
}
}
- // TODO: Convert this flag to bring the OM out of prepare mode with the new
- // bits when prepare marker files have been implemented.
-// /**
-// * This function implements a sub-command to allow the OM to be
-// * "prepared for upgrade".
-// */
-// @CommandLine.Command(name = "--prepareForUpgrade",
-// aliases = {"--prepareForDowngrade", "--flushTransactions"},
-// customSynopsis = "ozone om [global options] --prepareForUpgrade",
-// hidden = false,
-// description = "Prepare the OM for upgrade/downgrade. (Flush Raft log "
+
-// "transactions.)",
-// mixinStandardHelpOptions = true,
-// versionProvider = HddsVersionProvider.class)
-// @SuppressFBWarnings("DM_EXIT")
-// public void prepareOmForUpgrade() throws Exception {
-// commonInit();
-// boolean result = receiver.prepareForUpgrade(conf);
-// if (!result) {
-// throw new Exception("Prepare OM For Upgrade failed.");
-// }
-// System.exit(0);
-// }
+ /**
+ * This function implements a sub-command to allow the OM to be
+ * "prepared for upgrade".
+ */
+ @CommandLine.Command(name = "--upgrade",
Review comment:
Can we add an alias for downgrade as well?
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java
##########
@@ -343,6 +347,7 @@ public void pause() {
*/
public void unpause(long newLastAppliedSnaphsotIndex,
long newLastAppliedSnapShotTermIndex) {
+ LOG.info("Unpausing State machine at {}", this.ozoneManager.getOMNodeId());
Review comment:
Left over log line?
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java
##########
@@ -376,7 +381,15 @@ public long takeSnapshot() throws IOException {
long lastAppliedIndex = lastTermIndex.getIndex();
snapshotInfo.updateTermIndex(lastTermIndex.getTerm(),
lastAppliedIndex);
+ OMTransactionInfo build = new OMTransactionInfo.Builder()
+ .setTransactionIndex(lastAppliedIndex)
+ .setCurrentTerm(lastTermIndex.getTerm()).build();
+ Table<String, OMTransactionInfo> txnInfoTable =
+ ozoneManager.getMetadataManager().getTransactionInfoTable();
+ txnInfoTable.put(TRANSACTION_INFO_KEY, build);
ozoneManager.getMetadataManager().getStore().flushDB();
+ LOG.info("OM TransactionInfo Table : {}",
Review comment:
Left over log line?
----------------------------------------------------------------
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]