This is an automated email from the ASF dual-hosted git repository.
sarvekshayr 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 b0c52667fe2 HDDS-12072. Add Robot test for repair om
update-transaction (#11303)
b0c52667fe2 is described below
commit b0c52667fe2742b9160817ef21c86e889a2efe8d
Author: Russole Chen <[email protected]>
AuthorDate: Wed Sep 23 19:27:04 2026 +0800
HDDS-12072. Add Robot test for repair om update-transaction (#11303)
---
.../compose/ozonesecure-ha/test-repair-tools.sh | 4 ++
.../smoketest/repair/om-update-transaction.robot | 56 ++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git
a/hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-repair-tools.sh
b/hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-repair-tools.sh
index eb630e37008..0c23a86b1e7 100644
--- a/hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-repair-tools.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-repair-tools.sh
@@ -89,6 +89,10 @@ if ! execute_command_in_container scm1.org timeout 15s ozone
sh volume list 1>/d
fi
echo "Testing ratis transaction repair completed successfully."
+# Run against a checkpoint in the SCM container, where no OM process is
running.
+execute_robot_test ${SCM} -v
OM_DB:${OZONE_DIR}/compose/ozonesecure-ha/data/${OM}/metadata/om.db \
+ repair/om-update-transaction.robot
+
execute_robot_test ${OM} kinit.robot
echo "Creating test keys to verify om compaction"
diff --git
a/hadoop-ozone/dist/src/main/smoketest/repair/om-update-transaction.robot
b/hadoop-ozone/dist/src/main/smoketest/repair/om-update-transaction.robot
new file mode 100644
index 00000000000..01c2792e4cf
--- /dev/null
+++ b/hadoop-ozone/dist/src/main/smoketest/repair/om-update-transaction.robot
@@ -0,0 +1,56 @@
+# 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.
+
+*** Settings ***
+Documentation Test ozone repair om update-transaction against an offline
OM DB checkpoint.
+Library String
+Resource ../lib/os.robot
+Test Timeout 5 minutes
+Test Setup Create OM DB Checkpoint
+Test Teardown Remove Directory ${TEST_DIR} recursive=True
+
+*** Variables ***
+${OM_DB} /data/metadata/om.db
+
+*** Keywords ***
+Create OM DB Checkpoint
+ ${test_dir} = Execute mktemp -d
+ Set Test Variable ${TEST_DIR} ${test_dir}
+ Set Test Variable ${DB} ${TEST_DIR}/om.db
+ Execute ozone debug ldb --db=${OM_DB} checkpoint --output=${DB}
+
+Read Transaction Info
+ ${output} = Execute ozone debug ldb --db=${DB} scan
--cf=transactionInfoTable
+ ${info} = Execute echo '${output}' | jq -er
'.["#TRANSACTIONINFO"].transactionInfoString'
+ [return] ${info}
+
+*** Test Cases ***
+Update OM Transaction Info
+ ${original} = Read Transaction Info
+ ${term} ${index} = Split String ${original} \#
+ ${term} = Evaluate int($term) + 1
+ ${index} = Evaluate int($index) + 100
+
+ ${output} = Execute
+ ... ozone repair om update-transaction --db=${DB} --term=${term}
--index=${index} --dry-run
+ Should Contain ${output} [dry run] Updating transaction info to
(t:${term}, i:${index})
+ ${actual} = Read Transaction Info
+ Should Be Equal ${actual} ${original}
+
+ ${output} = Execute
+ ... echo y | ozone repair om update-transaction --db=${DB}
--term=${term} --index=${index}
+ Should Contain ${output} The highest transaction info has been
updated to: (t:${term}, i:${index})
+ ${actual} = Read Transaction Info
+ Should Be Equal ${actual} ${term}#${index}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]