You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/10 06:47:35 UTC

[GitHub] [ozone] avijayanhwx opened a new pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

avijayanhwx opened a new pull request #2017:
URL: https://github.com/apache/ozone/pull/2017


   ## What changes were proposed in this pull request?
   
   Although OM Finalization is a Ratis request, it updates a persistent location outside the OM state machine maintained "RocksDB". Hence, in a rare case where an unfinalized OM needs a Ratis snapshot to finalize (without any logs), the VERSION file will not be updated, and hence the OM will be stuck in that state.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-4908
   
   ## How was this patch tested?
   Manually tested by adding a new layout feature.
   Added integration tests.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on a change in pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#discussion_r594619410



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -143,6 +143,7 @@
   public static final String PREFIX_TABLE = "prefixTable";
   public static final String TRANSACTION_INFO_TABLE =
       "transactionInfoTable";
+  public static final String META_TABLE = "metaTable";

Review comment:
       Using this table as a generic table to store String,String "meta" information.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on a change in pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#discussion_r594618876



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/upgrade/OMUpgradeFinalizer.java
##########
@@ -100,6 +104,7 @@ public Void call() throws IOException {
         for (OMLayoutFeature f : versionManager.unfinalizedFeatures()) {
           finalizeFeature(f);
           updateLayoutVersionInVersionFile(f, ozoneManager.getOmStorage());
+          updateLayoutVersionInDB(f, ozoneManager);

Review comment:
       Agree, I have changed the way we write to the DB.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] errose28 commented on pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
errose28 commented on pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#issuecomment-800526655


   Thanks @avijayanhwx LGTM +1 pending CI.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx merged pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx merged pull request #2017:
URL: https://github.com/apache/ozone/pull/2017


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on a change in pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#discussion_r594619410



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -143,6 +143,7 @@
   public static final String PREFIX_TABLE = "prefixTable";
   public static final String TRANSACTION_INFO_TABLE =
       "transactionInfoTable";
+  public static final String META_TABLE = "metaTable";

Review comment:
       Using this table as a generic table to store <String,String> "meta" information.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on a change in pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#discussion_r594619044



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -550,6 +551,23 @@ private void instantiateServices(boolean withNewSnapshot) throws IOException {
     keyManager = new KeyManagerImpl(this, scmClient, configuration,
         omStorage.getOmId());
 
+    if (withNewSnapshot) {
+      Integer layoutVersionInDB = getLayoutVersionInDB();
+      if (layoutVersionInDB != null &&
+          versionManager.getMetadataLayoutVersion() < layoutVersionInDB) {
+        LOG.info("New OM snapshot received with higher layout version {}. " +
+            "Attempting to finalize current OM to that version.",
+            layoutVersionInDB);
+        upgradeFinalizer.finalizeAndWaitForCompletion(
+            "om-ratis-snapshot", this,
+            TimeUnit.SECONDS.toSeconds(10));

Review comment:
       Made it configurable.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#issuecomment-801610681


   Thanks for the review @errose28 & @swagle.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] errose28 commented on a change in pull request #2017: HDDS-4908. Layout version should be available in DB for an un-finalized OM to be finalized through a Ratis snapshot.

Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #2017:
URL: https://github.com/apache/ozone/pull/2017#discussion_r592506518



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -550,6 +551,23 @@ private void instantiateServices(boolean withNewSnapshot) throws IOException {
     keyManager = new KeyManagerImpl(this, scmClient, configuration,
         omStorage.getOmId());
 
+    if (withNewSnapshot) {
+      Integer layoutVersionInDB = getLayoutVersionInDB();
+      if (layoutVersionInDB != null &&
+          versionManager.getMetadataLayoutVersion() < layoutVersionInDB) {
+        LOG.info("New OM snapshot received with higher layout version {}. " +
+            "Attempting to finalize current OM to that version.",
+            layoutVersionInDB);
+        upgradeFinalizer.finalizeAndWaitForCompletion(
+            "om-ratis-snapshot", this,
+            TimeUnit.SECONDS.toSeconds(10));

Review comment:
       Any reason for choosing this value? Should it be configurable?

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/upgrade/OMUpgradeFinalizer.java
##########
@@ -100,6 +104,7 @@ public Void call() throws IOException {
         for (OMLayoutFeature f : versionManager.unfinalizedFeatures()) {
           finalizeFeature(f);
           updateLayoutVersionInVersionFile(f, ozoneManager.getOmStorage());
+          updateLayoutVersionInDB(f, ozoneManager);

Review comment:
       This will update the layout version in the DB in the finalize request, not the finalize response. Say the OM goes down while processing a finalize upgrade request but before it gets to this step. Will the DB still get the layout version info when the OM is restarted?

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -143,6 +143,7 @@
   public static final String PREFIX_TABLE = "prefixTable";
   public static final String TRANSACTION_INFO_TABLE =
       "transactionInfoTable";
+  public static final String META_TABLE = "metaTable";

Review comment:
       Can we come up with a better name than `metaTable`? Maybe `versionTable`?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org