This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 9a4035fc838 HDDS-17482. Unify rolling and non-rolling upgrade
acceptance suites (#12136)
9a4035fc838 is described below
commit 9a4035fc83896f1cce8ba8b62dcfb3b28ad6cbb4
Author: Zita Dombi <[email protected]>
AuthorDate: Wed Nov 25 21:15:44 2026 +0100
HDDS-17482. Unify rolling and non-rolling upgrade acceptance suites (#12136)
---
.../dist/src/main/compose/upgrade/README.md | 40 ++++++----
.../main/compose/upgrade/compose/non-ha/load.sh | 1 +
hadoop-ozone/dist/src/main/compose/upgrade/test.sh | 20 ++---
.../dist/src/main/compose/upgrade/testlib.sh | 8 +-
.../callbacks/common/callback.sh | 69 -----------------
.../upgrade/upgrades/non-rolling-upgrade/driver.sh | 90 ----------------------
.../callbacks/1.3.0/callback.sh | 6 +-
.../callbacks/1.4.0/callback.sh | 8 +-
.../callbacks/2.0.0/callback.sh | 10 +--
.../callbacks/common/callback.sh | 9 ++-
.../{rolling-upgrade => upgrade}/driver.sh | 68 +++++++++++++---
11 files changed, 114 insertions(+), 215 deletions(-)
diff --git a/hadoop-ozone/dist/src/main/compose/upgrade/README.md
b/hadoop-ozone/dist/src/main/compose/upgrade/README.md
index 6138a7b3830..a300ef32fad 100644
--- a/hadoop-ozone/dist/src/main/compose/upgrade/README.md
+++ b/hadoop-ozone/dist/src/main/compose/upgrade/README.md
@@ -28,7 +28,7 @@ an older release of Ozone and a later release (which may be
the local build).
2. After the release is finished and its docker image is published, add the
new version to the test matrix.
1. Comment out all `run_test` lines in *test.sh*.
- 2. Add a new line: `run_test ha non-rolling-upgrade
<newly-released-version> "$OZONE_CURRENT_VERSION"` before the commented out
lines.
+ 2. Add a new line: `run_test ha non-rolling <newly-released-version>
"$OZONE_CURRENT_VERSION"` before the commented out lines.
## Important Notes on Test Scope
@@ -48,21 +48,27 @@ Non-rolling upgrades and downgrades are supported from
1.1.0 to any later versio
### upgrades
-Each type of upgrade has a subdirectory under the *upgrades* directory.
+The upgrade suite lives in the *upgrades/upgrade* directory.
-- Each upgrade's steps are controlled by a *driver.sh* script in its
*upgrades/\<upgrade-type>* directory. Callbacks to execute throughout the
upgrade are called by this script and should be placed in a file called
*callback.sh* in the *upgrades/\<upgrade-type>/\<upgrade-to>* directory.
+- The upgrade steps are controlled by the *upgrades/upgrade/driver.sh* script.
Callbacks to execute throughout the upgrade are called by this script and
should be placed in a file called *callback.sh* in the
*upgrades/upgrade/callbacks/\<upgrade-to>* directory.
-- As the test is run, result logs and docker volume data for the upgrade for
these versions will be placed in
*upgrades/\<upgrade-type>/execution/\<upgrade-from>-\<upgrade-to>*. This allows
a suite of upgrades to be run without conflicting directory names.
+- As the test is run, result logs and docker volume data for the upgrade for
these versions will be placed in
*upgrades/upgrade/execution/\<compose-cluster>-\<execution-mode>-\<upgrade-from>-\<upgrade-to>*.
This allows a suite of upgrades to be run without conflicting directory names.
- The result logs of all upgrades run as part of the tests will be copied to a
*result* directory in the top level upgrade directory.
-#### non-rolling-upgrade
+#### Execution modes
-- Any necessary conversion of on disk structures from the old version to the
new version are handled by Ozone's non-rolling upgrade framework.
+The same driver and callbacks are used for both kinds of upgrade. The
`EXECUTION_MODE` (`rolling` or `non-rolling`), passed as the second argument to
`run_test`, selects how the cluster moves between versions and which robot
tests in *smoketest/upgrade/\<execution-mode>* are used to finalize and check
finalization status.
-- The name of each subdirectory in *non-rolling-upgrade* is a version to start
the upgrade test from, with a *callback.sh* file whose callbacks will be
invoked for any upgrade starting in that version.
+- `non-rolling`: Any necessary conversion of on disk structures from the old
version to the new version are handled by Ozone's non-rolling upgrade
framework. Before each version change the OMs are prepared, then the whole
cluster (including the client) is stopped and started again with the other
version.
-- The *common* directory contains callbacks used for all upgrade tests
regardless of the version.
+- `rolling`: The first upgrade is done as a rolling (zero-downtime) upgrade,
restarting one service at a time. The downgrade and the re-upgrade restart all
servers at once, unless `DOWNGRADE_AND_REUPGRADE_ROLLING` is set to `true` in
*driver.sh*. The client is upgraded after all servers, before finalization.
Both the start and end version must support rolling upgrade.
+
+#### callbacks
+
+- The name of each subdirectory in *callbacks* is a version to upgrade to,
with a *callback.sh* file whose callbacks will be invoked for any upgrade
ending in that version. These versions were released before rolling upgrade
support, so these callbacks only apply to the `non-rolling` mode and use the
non-rolling robot tests.
+
+- The *common* directory contains callbacks used for all upgrade tests
regardless of the version and execution mode.
- Supported Callbacks:
1. `with_old_version`: Run while ozone is in the original version to start
the upgrade from, before any upgrade steps have been done.
@@ -70,6 +76,7 @@ Each type of upgrade has a subdirectory under the *upgrades*
directory.
3. `with_old_version_downgraded`: Run after ozone is stopped in the new
version pre-finalized, and restarted in the old version again.
4. `with_this_version_finalized`: Run after ozone is stopped in the old
version after donwgrade, started again in the new version pre-finalized, and
then finalized.
- The upgrade is complete when this callback runs.
+ 5. `with_service_stopped`, `with_service_restarted`: Only in `rolling`
mode, run while a single service is stopped, and after it was started again
with the target version.
### compose
@@ -79,7 +86,7 @@ Docker compose cluster definitions to be used in upgrade
testing are defined in
- Data for each container is persisted in a mounted volume.
-- By default it's *data* under the
*upgrades/\<upgrade-type>/execution/\<from-version>-\<to-version>* directory,
but can be overridden with the `OZONE_VOLUME` environment variable.
+- By default it's *data* under the
*upgrades/upgrade/execution/\<compose-cluster>-\<execution-mode>-\<from-version>-\<to-version>*
directory, but can be overridden with the `OZONE_VOLUME` environment variable.
- Mounting volumes allows data to be persisted in the cluster throughout
container restarts, meaning that tests can check that data written in older
versions is still readable in newer versions.
@@ -89,23 +96,24 @@ Docker compose cluster definitions to be used in upgrade
testing are defined in
### Adding New Tests
-- Tests that should run for all upgrades, regardless of the version being
tested, can be added to *compose/upgrade/\<upgrade-type>/common/callback.sh*.
+- Tests that should run for all upgrades, regardless of the version being
tested, can be added to
*compose/upgrade/upgrades/upgrade/callbacks/common/callback.sh*.
-- Tests that should run only for an upgrade to a specific version can be added
to
*compose/upgrade/upgrades/\<upgrade-type>/\<ending-upgrade-version>/callback.sh*.
+- Tests that should run only for an upgrade to a specific version can be added
to
*compose/upgrade/upgrades/upgrade/callbacks/\<ending-upgrade-version>/callback.sh*.
- Add commands in the callback function when they should be run. Each callback
file will have access to the following environment variables:
- `OZONE_UPGRADE_FROM`: The version of ozone being upgraded from.
- `OZONE_UPGRADE_TO`: The version of ozone being upgraded to.
+ - `EXECUTION_MODE`: The execution mode of the upgrade, `rolling` or
`non-rolling`.
- `TEST_DIR`: The top level *upgrade* directory containing all files for
upgrade testing.
- - `SCM`: The name of the SCM container to run robot tests from.
+ - `SCM`: The name of the SCM container.
+ - `CLIENT`: The container to run robot tests from.
- This can be passed as the first argument to `execute_robot_test`.
- - This allows the same tests to work with and without SCM HA.
- - `CLIENT`: The dedicated client container used to run Robot tests in
rolling-upgrade HA.
+ - It is the dedicated `client` container in the *ha* cluster, and the SCM
container in the *non-ha* cluster.
### Testing New Versions
-- To test upgrade between different versions, add a line `run_test
<compose-cluster-directory> <upgrade-type> <old-version> <new-version>` to the
top level *test.sh* file.
- - The `run_test` function will execute
*upgrades/\<upgrade-type>/driver.sh* with the callbacks defined in
*upgrades/\<upgrade-type>/common/callback.sh* and
*upgrades/\<upgrade-type>/\<new-version>/callback.sh*.
+- To test upgrade between different versions, add a line `run_test
<compose-cluster-directory> <rolling|non-rolling> <old-version> <new-version>`
to the top level *test.sh* file.
+ - The `run_test` function will execute *upgrades/upgrade/driver.sh* in
the given execution mode with the callbacks defined in
*upgrades/upgrade/callbacks/common/callback.sh* and
*upgrades/upgrade/callbacks/\<new-version>/callback.sh*.
- The variable `OZONE_CURRENT_VERSION` is used to define the version
corresponding to the locally built source code in the `apache/ozone-runner`
image.
- All other versions will be treated as tags specifying a released version
of the `apache/ozone` docker image to use.
diff --git a/hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/load.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/load.sh
index 8c5c5631c73..60d2eaf36b7 100644
--- a/hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/load.sh
+++ b/hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/load.sh
@@ -24,6 +24,7 @@ set +u
source "$TEST_DIR/testlib.sh"
export COMPOSE_FILE="$TEST_DIR/compose/non-ha/docker-compose.yaml"
+export CLIENT=scm
export SECURITY_ENABLED=false
create_data_dirs dn{1..5} om recon s3g scm
diff --git a/hadoop-ozone/dist/src/main/compose/upgrade/test.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/test.sh
index 4a16958e975..50976e1e516 100755
--- a/hadoop-ozone/dist/src/main/compose/upgrade/test.sh
+++ b/hadoop-ozone/dist/src/main/compose/upgrade/test.sh
@@ -34,19 +34,19 @@ RESULT_DIR="$ALL_RESULT_DIR" create_results_dir
# Rolling upgrade test. This requires both the start and end version to
support rolling upgrade.
# Since we have not yet done a release with rolling upgrade support, it is
just doing a rolling
# restart in the same version for now.
-# run_test ha rolling-upgrade "$OZONE_CURRENT_VERSION"
"$OZONE_CURRENT_VERSION"
+# run_test ha rolling "$OZONE_CURRENT_VERSION" "$OZONE_CURRENT_VERSION"
# This is the version of Ozone that should use the runner image to run the
# code that was built. Other versions will pull images from docker hub.
-run_test ha non-rolling-upgrade 2.2.2 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 2.1.1 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 2.0.0 "$OZONE_CURRENT_VERSION"
-# run_test non-ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 1.4.0 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 1.3.0 "$OZONE_CURRENT_VERSION"
-# run_test ha non-rolling-upgrade 1.2.1 "$OZONE_CURRENT_VERSION"
-# run_test om-ha non-rolling-upgrade 1.1.0 "$OZONE_CURRENT_VERSION"
+run_test ha non-rolling 2.2.2 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 2.1.1 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 2.0.0 "$OZONE_CURRENT_VERSION"
+# run_test non-ha non-rolling 1.4.1 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 1.4.1 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 1.4.0 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 1.3.0 "$OZONE_CURRENT_VERSION"
+# run_test ha non-rolling 1.2.1 "$OZONE_CURRENT_VERSION"
+# run_test om-ha non-rolling 1.1.0 "$OZONE_CURRENT_VERSION"
generate_report "upgrade" "$ALL_RESULT_DIR"
diff --git a/hadoop-ozone/dist/src/main/compose/upgrade/testlib.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/testlib.sh
index 1b5cb1c3b45..e0078ebb81e 100755
--- a/hadoop-ozone/dist/src/main/compose/upgrade/testlib.sh
+++ b/hadoop-ozone/dist/src/main/compose/upgrade/testlib.sh
@@ -82,18 +82,18 @@ callback() {
# versions and docker compose cluster.
## @param The directory with a load.sh file that can be sourced to load the
# docker compose cluster to run the test in.
-## @param The directory of the upgrade type to run.
+## @param The execution mode of the upgrade: rolling or non-rolling.
## @param The version of Ozone to upgrade from.
## @param The version of Ozone to upgrade to.
run_test() {
local compose_cluster="$1"
- local upgrade_type="$2"
+ export EXECUTION_MODE="$2"
export OZONE_UPGRADE_FROM="$3"
export OZONE_UPGRADE_TO="$4"
- local test_dir="$_upgrade_dir/upgrades/$upgrade_type"
+ local test_dir="$_upgrade_dir/upgrades/upgrade"
local callback_dir="$test_dir"/callbacks
- local
execution_dir="$test_dir"/execution/"$compose_cluster-$upgrade_type-${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}"
+ local
execution_dir="$test_dir"/execution/"$compose_cluster-$EXECUTION_MODE-${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}"
local compose_dir="$_upgrade_dir"/compose/"$compose_cluster"
# Export variables needed by test, since it is run in a subshell.
export OZONE_UPGRADE_CALLBACK="$callback_dir"/"$OZONE_UPGRADE_TO"/callback.sh
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/common/callback.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/common/callback.sh
deleted file mode 100755
index a05e3e74f13..00000000000
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/common/callback.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/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.
-
-source "$TEST_DIR"/testlib.sh
-
-### CALLBACKS ###
-
-with_old_version() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
finalized upgrade/non-rolling/check-finalization.robot
- generate old1 "$SCM"
- validate old1 "$SCM"
- snapshot old1 original "$SCM" --include create-snapshot
- # The new version replays the WAL of this diff into db.snapdiff SST files,
which must stay readable after downgrade
- snapshot old1 original2 "$SCM" -v FROM_SNAPSHOT:original -v
EARLIER_SNAPSHOTS:original
-}
-
-with_this_version_pre_finalized() {
- # No check for pre-finalized status here, because the release may not have
- # added layout features to OM or HDDS.
- validate old1 "$SCM"
- # HDDS-6261: overwrite the same keys intentionally
- generate old1 "$SCM" --exclude create-volume-and-bucket
-
- generate new1 "$SCM"
- validate new1 "$SCM"
-
- snapshot old1 pre-finalized "$SCM" -v FROM_SNAPSHOT:original2 -v
EARLIER_SNAPSHOTS:original,original2
-}
-
-with_old_version_downgraded() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
finalized upgrade/non-rolling/check-finalization.robot
- validate old1 "$SCM"
- validate new1 "$SCM"
-
- generate old2 "$SCM"
- validate old2 "$SCM"
-
- # HDDS-6261: overwrite the same keys again to trigger the precondition check
- # that exists <= 1.1.0 OM
- generate old1 "$SCM" --exclude create-volume-and-bucket
-
- snapshot old1 downgraded "$SCM" -v FROM_SNAPSHOT:pre-finalized -v
EARLIER_SNAPSHOTS:original,original2,pre-finalized
-}
-
-with_this_version_finalized() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
finalized upgrade/non-rolling/check-finalization.robot
- validate old1 "$SCM"
- validate new1 "$SCM"
- validate old2 "$SCM"
-
- generate new2 "$SCM"
- validate new2 "$SCM"
-
- snapshot old1 finalized "$SCM" -v FROM_SNAPSHOT:downgraded -v
EARLIER_SNAPSHOTS:original,original2,pre-finalized,downgraded
-}
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/driver.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/driver.sh
deleted file mode 100755
index 27b4b455525..00000000000
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/driver.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/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.
-
-# This script tests upgrade from a previous release to the current
-# binaries. Docker image with Ozone binaries is required for the
-# initial version, while the snapshot version uses Ozone runner image.
-
-set -e -o pipefail
-
-# Fail if required vars are not set.
-set -u
-: "${OZONE_UPGRADE_FROM}"
-: "${OZONE_UPGRADE_TO}"
-: "${TEST_DIR}"
-: "${SCM}"
-: "${OZONE_CURRENT_VERSION}"
-set +u
-
-echo "--- RUNNING NON-ROLLING UPGRADE TEST FROM $OZONE_UPGRADE_FROM TO
$OZONE_UPGRADE_TO ---"
-
-source "$TEST_DIR"/testlib.sh
-
-set_downgrade_om_args() {
- # 1.1.0 Is the earliest version we support upgrade/downgrade to, but it did
- # not have OM prepare.
- if [[ "$OZONE_UPGRADE_FROM" != '1.1.0' ]]; then
- export OM_HA_ARGS='--downgrade'
- else
- export OM_HA_ARGS='--'
- fi
-}
-
-echo "--- SETTING UP OLD VERSION $OZONE_UPGRADE_FROM ---"
-OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-1-original"
-export OM_HA_ARGS='--'
-prepare_for_image "$OZONE_UPGRADE_FROM"
-
-echo "--- RUNNING WITH OLD VERSION $OZONE_UPGRADE_FROM ---"
-start_docker_env
-wait_for_all_oms
-callback with_old_version
-
-execute_robot_test "$SCM" -N "${OUTPUT_NAME}-prepare"
upgrade/non-rolling/prepare.robot
-stop_docker_env
-prepare_for_image "$OZONE_UPGRADE_TO"
-export OM_HA_ARGS='--upgrade'
-
-echo "--- RUNNING WITH NEW VERSION $OZONE_UPGRADE_TO PRE-FINALIZED ---"
-OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-2-pre-finalized"
-OZONE_KEEP_RESULTS=true start_docker_env
-wait_for_all_oms
-callback with_this_version_pre_finalized
-execute_robot_test "$SCM" -N "${OUTPUT_NAME}-prepare"
upgrade/non-rolling/prepare.robot
-stop_docker_env
-prepare_for_image "$OZONE_UPGRADE_FROM"
-set_downgrade_om_args
-
-echo "--- RUNNING WITH OLD VERSION $OZONE_UPGRADE_FROM AFTER DOWNGRADE ---"
-OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-3-downgraded"
-OZONE_KEEP_RESULTS=true start_docker_env
-wait_for_all_oms
-callback with_old_version_downgraded
-
-execute_robot_test "$SCM" -N "${OUTPUT_NAME}-prepare"
upgrade/non-rolling/prepare.robot
-stop_docker_env
-prepare_for_image "$OZONE_UPGRADE_TO"
-export OM_HA_ARGS='--upgrade'
-
-echo "--- RUNNING WITH NEW VERSION $OZONE_UPGRADE_TO FINALIZED ---"
-OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-4-finalized"
-OZONE_KEEP_RESULTS=true start_docker_env
-wait_for_all_oms
-
-# Sends commands to finalize OM and SCM.
-execute_robot_test "$SCM" -N "${OUTPUT_NAME}-finalize"
upgrade/non-rolling/finalize.robot
-callback with_this_version_finalized
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.3.0/callback.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.3.0/callback.sh
similarity index 74%
rename from
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.3.0/callback.sh
rename to
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.3.0/callback.sh
index 6d68a78a6c5..00830fb49b9 100755
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.3.0/callback.sh
+++
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.3.0/callback.sh
@@ -20,11 +20,11 @@ source "$TEST_DIR"/testlib.sh
with_this_version_pre_finalized() {
# New layout features were added in this version, so OM and SCM should be
# pre-finalized.
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
pre-finalized upgrade/non-rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include pre-finalized upgrade/non-rolling/check-finalization.robot
# Test that EC is disabled when pre-finalized.
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-ec" --include
pre-finalized-ec-tests ec/upgrade-ec-check.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-ec" --include
pre-finalized-ec-tests ec/upgrade-ec-check.robot
}
with_this_version_finalized() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-ec" --include
post-finalized-ec-tests ec/upgrade-ec-check.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-ec" --include
post-finalized-ec-tests ec/upgrade-ec-check.robot
}
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.4.0/callback.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.4.0/callback.sh
similarity index 65%
rename from
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.4.0/callback.sh
rename to
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.4.0/callback.sh
index 1dccca15a2c..6f2bcae255b 100644
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/1.4.0/callback.sh
+++
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/1.4.0/callback.sh
@@ -21,12 +21,12 @@ source "$TEST_DIR"/testlib.sh
### CALLBACKS ###
with_this_version_pre_finalized() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
pre-finalized upgrade/non-rolling/check-finalization.robot
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-snapshot" --include
pre-finalized-snapshot-tests snapshot/upgrade-snapshot-check.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include pre-finalized upgrade/non-rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-snapshot" --include
pre-finalized-snapshot-tests snapshot/upgrade-snapshot-check.robot
}
with_this_version_finalized() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
finalized upgrade/non-rolling/check-finalization.robot
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-snapshot"
snapshot/snapshot-sh.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized upgrade/non-rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-snapshot"
snapshot/snapshot-sh.robot
}
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/2.0.0/callback.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/2.0.0/callback.sh
similarity index 64%
rename from
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/2.0.0/callback.sh
rename to
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/2.0.0/callback.sh
index c8de504d0fa..694d60d9a6c 100644
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/non-rolling-upgrade/callbacks/2.0.0/callback.sh
+++
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/2.0.0/callback.sh
@@ -19,13 +19,13 @@ source "$TEST_DIR"/testlib.sh
with_this_version_pre_finalized() {
# New layout features were added in this version, so OM and SCM should be
pre-finalized.
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
pre-finalized upgrade/non-rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include pre-finalized upgrade/non-rolling/check-finalization.robot
# Test that HSync is disabled when pre-finalized.
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-hsync" --include
pre-finalized-hsync-tests hsync/upgrade-hsync-check.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-hsync" --include
pre-finalized-hsync-tests hsync/upgrade-hsync-check.robot
}
with_this_version_finalized() {
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include
finalized upgrade/non-rolling/check-finalization.robot
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-hsync"
admincli/lease-recovery.robot
- execute_robot_test "$SCM" -N "${OUTPUT_NAME}-freon-hsync" freon/hsync.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized upgrade/non-rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-hsync"
admincli/lease-recovery.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-freon-hsync"
freon/hsync.robot
}
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/callbacks/common/callback.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/common/callback.sh
similarity index 88%
rename from
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/callbacks/common/callback.sh
rename to
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/common/callback.sh
index 97bcd0ad92d..d876efbe1fa 100644
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/callbacks/common/callback.sh
+++
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/callbacks/common/callback.sh
@@ -32,7 +32,7 @@ with_service_restarted() {
}
with_old_version() {
- execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized upgrade/rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized "upgrade/${EXECUTION_MODE}/check-finalization.robot"
generate old1 "$CLIENT"
validate old1 "$CLIENT"
@@ -52,13 +52,14 @@ with_this_version_pre_finalized() {
validate new1 "$CLIENT"
validate overwrite "$CLIENT"
+ # HDDS-6261: overwrite the same keys intentionally
generate overwrite "$CLIENT" --exclude create-volume-and-bucket
snapshot overwrite pre-finalized "$CLIENT" -v FROM_SNAPSHOT:original2 -v
EARLIER_SNAPSHOTS:original,original2
}
with_old_version_downgraded() {
- execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized upgrade/rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized "upgrade/${EXECUTION_MODE}/check-finalization.robot"
validate old1 "$CLIENT"
validate new1 "$CLIENT"
@@ -66,13 +67,15 @@ with_old_version_downgraded() {
validate old2 "$CLIENT"
validate overwrite "$CLIENT"
+ # HDDS-6261: overwrite the same keys again to trigger the precondition check
+ # that exists <= 1.1.0 OM
generate overwrite "$CLIENT" --exclude create-volume-and-bucket
snapshot overwrite downgraded "$CLIENT" -v FROM_SNAPSHOT:pre-finalized -v
EARLIER_SNAPSHOTS:original,original2,pre-finalized
}
with_this_version_finalized() {
- execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized upgrade/rolling/check-finalization.robot
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-check-finalization"
--include finalized "upgrade/${EXECUTION_MODE}/check-finalization.robot"
validate old1 "$CLIENT"
validate new1 "$CLIENT"
validate old2 "$CLIENT"
diff --git
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/driver.sh
b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/driver.sh
similarity index 72%
rename from
hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/driver.sh
rename to hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/driver.sh
index 40c222da95f..f1d31c222ba 100755
---
a/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/driver.sh
+++ b/hadoop-ozone/dist/src/main/compose/upgrade/upgrades/upgrade/driver.sh
@@ -28,12 +28,19 @@ set -u
: "${TEST_DIR}"
: "${CLIENT}"
: "${OZONE_CURRENT_VERSION}"
+: "${EXECUTION_MODE}"
set +u
-echo "--- RUNNING ROLLING UPGRADE TEST FROM $OZONE_UPGRADE_FROM TO
$OZONE_UPGRADE_TO ---"
+if [[ "$EXECUTION_MODE" != "rolling" && "$EXECUTION_MODE" != "non-rolling" ]];
then
+ echo "Unsupported EXECUTION_MODE: $EXECUTION_MODE (expected rolling or
non-rolling)" >&2
+ exit 1
+fi
+
+echo "--- RUNNING ${EXECUTION_MODE} UPGRADE TEST FROM $OZONE_UPGRADE_FROM TO
$OZONE_UPGRADE_TO ---"
source "$TEST_DIR"/testlib.sh
+# Only used in rolling execution mode.
# The first upgrade (old -> new) is always exercised as a rolling
(zero-downtime) upgrade,
# since that is the path this suite exists to prove. The downgrade and the
subsequent
# re-upgrade are run NON-ROLLING (all servers restarts at once) to save CI
time. The
@@ -135,8 +142,35 @@ non_rolling_restart_all_services() {
wait_for_all_oms
}
+set_downgrade_om_args() {
+ # 1.1.0 Is the earliest version we support upgrade/downgrade to, but it did
+ # not have OM prepare.
+ if [[ "$OZONE_UPGRADE_FROM" != '1.1.0' ]]; then
+ export OM_HA_ARGS='--downgrade'
+ else
+ export OM_HA_ARGS='--'
+ fi
+}
+
+## @description Prepare OMs, then restart the whole cluster (including the
client) with the target image.
+## Used in non-rolling execution mode.
+## @param target image
+## @param arguments passed to the OMs
+prepare_and_restart_cluster() {
+ local target_image="$1"
+ local om_args="$2"
+
+ execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-prepare"
upgrade/non-rolling/prepare.robot
+ stop_docker_env
+ prepare_for_image "${target_image}"
+ export OM_HA_ARGS="${om_args}"
+ OZONE_KEEP_RESULTS=true start_docker_env
+ wait_for_all_oms
+}
+
echo "--- SETTING UP OLD VERSION $OZONE_UPGRADE_FROM ---"
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-1-original"
+export OM_HA_ARGS='--'
prepare_for_image "$OZONE_UPGRADE_FROM"
echo "--- RUNNING WITH OLD VERSION $OZONE_UPGRADE_FROM ---"
@@ -145,14 +179,21 @@ wait_for_all_oms
callback with_old_version
-echo "--- ROLLING UPGRADE TO $OZONE_UPGRADE_TO PRE-FINALIZED ---"
-rolling_restart_all_services "2-upgrade" "$OZONE_UPGRADE_TO"
+echo "--- UPGRADE TO $OZONE_UPGRADE_TO PRE-FINALIZED ---"
+if [[ "$EXECUTION_MODE" == "rolling" ]]; then
+ rolling_restart_all_services "2-upgrade" "$OZONE_UPGRADE_TO"
+else
+ prepare_and_restart_cluster "$OZONE_UPGRADE_TO" '--upgrade'
+fi
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-2-pre-finalized"
callback with_this_version_pre_finalized
echo "--- DOWNGRADE TO $OZONE_UPGRADE_FROM ---"
-if [[ "$DOWNGRADE_AND_REUPGRADE_ROLLING" == "true" ]]; then
+if [[ "$EXECUTION_MODE" == "non-rolling" ]]; then
+ set_downgrade_om_args
+ prepare_and_restart_cluster "$OZONE_UPGRADE_FROM" "$OM_HA_ARGS"
+elif [[ "$DOWNGRADE_AND_REUPGRADE_ROLLING" == "true" ]]; then
rolling_restart_all_services "3-downgrade" "$OZONE_UPGRADE_FROM" "reverse"
else
non_rolling_restart_all_services "3-downgrade" "$OZONE_UPGRADE_FROM"
@@ -162,7 +203,9 @@
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-3-downgraded"
callback with_old_version_downgraded
echo "--- UPGRADE TO $OZONE_UPGRADE_TO ---"
-if [[ "$DOWNGRADE_AND_REUPGRADE_ROLLING" == "true" ]]; then
+if [[ "$EXECUTION_MODE" == "non-rolling" ]]; then
+ prepare_and_restart_cluster "$OZONE_UPGRADE_TO" '--upgrade'
+elif [[ "$DOWNGRADE_AND_REUPGRADE_ROLLING" == "true" ]]; then
rolling_restart_all_services "4-upgrade" "$OZONE_UPGRADE_TO"
else
non_rolling_restart_all_services "4-upgrade" "$OZONE_UPGRADE_TO"
@@ -170,15 +213,18 @@ fi
# Upgrade client after all server components are upgraded but before
finalization,
# so new client APIs can be exercised against pre-finalized servers.
-echo "--- UPGRADING CLIENT TO $OZONE_UPGRADE_TO ---"
-OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-4-upgrade-client"
-stop_containers "$CLIENT"
-prepare_for_image "${OZONE_UPGRADE_TO}"
-create_containers "$CLIENT"
+# In non-rolling upgrade the client was already restarted with the whole
cluster.
+if [[ "$EXECUTION_MODE" == "rolling" ]]; then
+ echo "--- UPGRADING CLIENT TO $OZONE_UPGRADE_TO ---"
+ OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-4-upgrade-client"
+ stop_containers "$CLIENT"
+ prepare_for_image "${OZONE_UPGRADE_TO}"
+ create_containers "$CLIENT"
+fi
echo "--- RUNNING WITH NEW VERSION $OZONE_UPGRADE_TO FINALIZED ---"
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-5-finalized"
# Sends command to finalize the cluster.
-execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-finalize"
upgrade/rolling/finalize.robot
+execute_robot_test "$CLIENT" -N "${OUTPUT_NAME}-finalize"
"upgrade/${EXECUTION_MODE}/finalize.robot"
callback with_this_version_finalized
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]