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/01/14 18:58:34 UTC
[GitHub] [ozone] errose28 opened a new pull request #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
errose28 opened a new pull request #1798:
URL: https://github.com/apache/ozone/pull/1798
## What changes were proposed in this pull request?
When an OM is put in prepare mode, a marker file is written to disk so that it remains in prepare mode upon restart. After an OM has been upgraded, it can be restarted with a --upgrade flag to automatically delete the marker file and take the OM out of prepare mode.
This patch incorporates work in progress changes from HDDS-4610 to make sure that the commit transaction after prepare updates the transaction index in the OM DB, so it matches the index of the prepare marker file when the OM comes back up.
## What is the link to the Apache JIRA
HDDS-4645
Please replace this section with the link to the Apache JIRA)
Acceptance test added.
The added test uses a similar approach to the existing *upgrade* acceptance test to restart the OMs. All containers in the cluster write their state to mounted volumes, and nodes are restarted by restarting their containers. These restarted containers have the previous on disk state still persistent in the volume when it is mounted on restart.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r560346680
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/.env
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+HDDS_VERSION=1.1.0-SNAPSHOT
+OZONE_RUNNER_VERSION=20200625-1
+OZONE_IMAGE=apache/ozone-runner:20200625-1
+OZONE_DIR=/opt/hadoop
+OZONE_VOLUME=.
+OM_HA_ARGS=--
Review comment:
I should probably add a comment here to explain this. The command line args are passed to the OM in the docker compose file. When docker compose expands an environment variable and the variable is unset or empty, it will expand it to an empty string `''` and pass that literally to OM, which is an invalid argument.
To get around this, I used `--` as the default value instead of empty, which tells the CLI parser that optional flags are done and everything following is an argument. For example, `ls -- -l` gives: `ls: cannot access '-l': No such file or directory`. In this case, since there are no arguments on either side, it is used to indicate that the OM has no arguments, without using an empty string.
If you have a better way to implement this, let me know. This is just what I came up with to make it work.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r560772985
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/.env
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+HDDS_VERSION=1.1.0-SNAPSHOT
+OZONE_RUNNER_VERSION=20200625-1
+OZONE_IMAGE=apache/ozone-runner:20200625-1
+OZONE_DIR=/opt/hadoop
+OZONE_VOLUME=.
+OM_HA_ARGS=--
Review comment:
@errose28 Thanks for the explanation, I am OK with this approach. We can revisit it later if needed.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r558828286
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/.env
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+HDDS_VERSION=1.1.0-SNAPSHOT
+OZONE_RUNNER_VERSION=20200625-1
+OZONE_IMAGE=apache/ozone-runner:20200625-1
+OZONE_DIR=/opt/hadoop
+OZONE_VOLUME=.
+OM_HA_ARGS=--
Review comment:
Just curious, why do we need a "--" for OM_HA_ARGS?
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/test.sh
##########
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+export COMPOSE_DIR
+
+: "${OZONE_REPLICATION_FACTOR:=3}"
+: "${OZONE_VOLUME:="${COMPOSE_DIR}/data"}"
+
+export OZONE_VOLUME
+
+# Clean up saved internal state from each container's volume for the next run.
+rm -rf "${OZONE_VOLUME}"
+mkdir -p "${OZONE_VOLUME}"/{dn1,dn2,dn3,om1,om2,om3,scm}
+
+if [[ -n "${OZONE_VOLUME_OWNER}" ]]; then
+ current_user=$(whoami)
+ if [[ "${OZONE_VOLUME_OWNER}" != "${current_user}" ]]; then
+ chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}" \
+ || sudo chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}"
+ fi
+fi
+
+export OZONE_DIR=/opt/hadoop
+# shellcheck source=/dev/null
+source "${COMPOSE_DIR}/../testlib.sh"
+
+# Write data and prepare cluster.
+start_docker_env
+execute_robot_test scm omha/om-prepare.robot
+KEEP_RUNNING=false stop_docker_env
+
+# re-start cluster with --upgrade flag to take it out of prepare.
+export OM_HA_ARGS='--upgrade'
Review comment:
Do we need to add a test case to verify that a regular restart of OM does not bring it out of "prepared" state?
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/test.sh
##########
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+export COMPOSE_DIR
+
+: "${OZONE_REPLICATION_FACTOR:=3}"
+: "${OZONE_VOLUME:="${COMPOSE_DIR}/data"}"
+
+export OZONE_VOLUME
+
+# Clean up saved internal state from each container's volume for the next run.
+rm -rf "${OZONE_VOLUME}"
+mkdir -p "${OZONE_VOLUME}"/{dn1,dn2,dn3,om1,om2,om3,scm}
+
+if [[ -n "${OZONE_VOLUME_OWNER}" ]]; then
+ current_user=$(whoami)
+ if [[ "${OZONE_VOLUME_OWNER}" != "${current_user}" ]]; then
+ chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}" \
+ || sudo chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}"
+ fi
+fi
+
+export OZONE_DIR=/opt/hadoop
+# shellcheck source=/dev/null
+source "${COMPOSE_DIR}/../testlib.sh"
+
+# Write data and prepare cluster.
+start_docker_env
+execute_robot_test scm omha/om-prepare.robot
Review comment:
Can we add a test case in om-prepare.robot to make sure writes are no longer allowed after preparation?
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
avijayanhwx merged pull request #1798:
URL: https://github.com/apache/ozone/pull/1798
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r560340180
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/test.sh
##########
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+export COMPOSE_DIR
+
+: "${OZONE_REPLICATION_FACTOR:=3}"
+: "${OZONE_VOLUME:="${COMPOSE_DIR}/data"}"
+
+export OZONE_VOLUME
+
+# Clean up saved internal state from each container's volume for the next run.
+rm -rf "${OZONE_VOLUME}"
+mkdir -p "${OZONE_VOLUME}"/{dn1,dn2,dn3,om1,om2,om3,scm}
+
+if [[ -n "${OZONE_VOLUME_OWNER}" ]]; then
+ current_user=$(whoami)
+ if [[ "${OZONE_VOLUME_OWNER}" != "${current_user}" ]]; then
+ chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}" \
+ || sudo chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}"
+ fi
+fi
+
+export OZONE_DIR=/opt/hadoop
+# shellcheck source=/dev/null
+source "${COMPOSE_DIR}/../testlib.sh"
+
+# Write data and prepare cluster.
+start_docker_env
+execute_robot_test scm omha/om-prepare.robot
Review comment:
Sure. I actually added this while doing HDDS-4611, I will put it in here so it gets in first.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r558601215
##########
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:
Yes, removed.
##########
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:
Yes, removed.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r558601215
##########
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:
Yes, will remove
##########
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:
Yes, will remove.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
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:
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#issuecomment-763818837
CI failure is unrelated. Merging the changes.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r560341496
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/test.sh
##########
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+export COMPOSE_DIR
+
+: "${OZONE_REPLICATION_FACTOR:=3}"
+: "${OZONE_VOLUME:="${COMPOSE_DIR}/data"}"
+
+export OZONE_VOLUME
+
+# Clean up saved internal state from each container's volume for the next run.
+rm -rf "${OZONE_VOLUME}"
+mkdir -p "${OZONE_VOLUME}"/{dn1,dn2,dn3,om1,om2,om3,scm}
+
+if [[ -n "${OZONE_VOLUME_OWNER}" ]]; then
+ current_user=$(whoami)
+ if [[ "${OZONE_VOLUME_OWNER}" != "${current_user}" ]]; then
+ chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}" \
+ || sudo chown -R "${OZONE_VOLUME_OWNER}" "${OZONE_VOLUME}"
+ fi
+fi
+
+export OZONE_DIR=/opt/hadoop
+# shellcheck source=/dev/null
+source "${COMPOSE_DIR}/../testlib.sh"
+
+# Write data and prepare cluster.
+start_docker_env
+execute_robot_test scm omha/om-prepare.robot
+KEEP_RUNNING=false stop_docker_env
+
+# re-start cluster with --upgrade flag to take it out of prepare.
+export OM_HA_ARGS='--upgrade'
Review comment:
Yes, I can add this.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r558600361
##########
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:
Yes, forgot to change it, thanks.
----------------------------------------------------------------
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 #1798: HDDS-4645. Starting OM with the --upgrade flag should delete the prepare marker file.
Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #1798:
URL: https://github.com/apache/ozone/pull/1798#discussion_r560346680
##########
File path: hadoop-ozone/dist/src/main/compose/ozone-om-prepare/.env
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+HDDS_VERSION=1.1.0-SNAPSHOT
+OZONE_RUNNER_VERSION=20200625-1
+OZONE_IMAGE=apache/ozone-runner:20200625-1
+OZONE_DIR=/opt/hadoop
+OZONE_VOLUME=.
+OM_HA_ARGS=--
Review comment:
I should probably add a comment here to explain this. The command line args are passed to the OM in the docker compose file. When docker compose expands an environment variable and the variable is unset or empty, it will expand it to an empty string `''` and pass that literally to OM, which is an invalid argument.
To get around this, I used `--` as the default value instead of empty, which tells the CLI parser that optional flags are done and everything following is an argument. For example, `ls -- -l` gives: `ls: cannot access '-l': No such file or directory`. In the OM/docker compose case, since there are no arguments on either side, it is used to indicate that the OM has no arguments, without using an empty string.
If you have a better way to implement this, let me know. This is just what I came up with to make it work.
----------------------------------------------------------------
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