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 5d40bd20fce HDDS-14622. OM DB size should be reduced after compaction 
(#10645)
5d40bd20fce is described below

commit 5d40bd20fcef027516b4bbeaff9093026a721efc
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Fri Jul 3 17:30:45 2026 +0200

    HDDS-14622. OM DB size should be reduced after compaction (#10645)
---
 .../compose/ozonesecure-ha/test-repair-tools.sh    | 30 +++++++++++-
 .../src/main/smoketest/repair/om-compact.robot     | 54 ----------------------
 2 files changed, 28 insertions(+), 56 deletions(-)

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 ca6fa5a0cbd..1e8f2d78eb2 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
@@ -93,10 +93,36 @@ execute_robot_test ${OM} kinit.robot
 
 echo "Creating test keys to verify om compaction"
 om_container="ozonesecure-ha-om1-1"
-docker exec "${om_container}" ozone freon ockg -n 100000 -t 20 -s 0 > 
/dev/null 2>&1
+docker exec "${om_container}" ozone freon ockg -n 1000 -t 4 -s 0 > /dev/null 
2>&1
 echo "Test keys created"
 
 echo "Restarting OM after key creation to flush and generate sst files"
 docker restart "${om_container}"
+# Delete keys to create tombstones that need compaction
+execute_command_in_container ${OM} ozone fs -rm -R -skipTrash 
ofs://${OM_SERVICE_ID}/vol1/bucket1
 
-execute_robot_test ${OM} repair/om-compact.robot
+get_om_db_size() {
+  execute_command_in_container ${OM} find /data/metadata/om.db -name '*.sst' 
-exec du -b {} + \
+      | awk '{ sum += $1}  END { print sum }'
+}
+
+check_om_log() {
+  docker-compose logs "${OM}" | grep "Compaction request for column family 
\"${1}\" completed"
+}
+
+compact_om_db() {
+  for cf in "$@"; do
+    execute_command_in_container ${OM} ozone repair om compact --cf="${cf}" 
--service-id "${OM_SERVICE_ID}" --node-id "${OM}" --blc 2
+    retry check_om_log "$cf"
+  done
+}
+
+declare -i size_before_compaction size_after_compaction
+size_before_compaction=$(get_om_db_size)
+compact_om_db fileTable deletedTable deletedDirectoryTable
+size_after_compaction=$(get_om_db_size)
+
+if [[ ${size_before_compaction} -lt ${size_after_compaction} ]]; then
+  echo "OM DB size should be reduced after compaction. Before: 
${size_before_compaction}, After: ${size_after_compaction}"
+  exit 1
+fi
diff --git a/hadoop-ozone/dist/src/main/smoketest/repair/om-compact.robot 
b/hadoop-ozone/dist/src/main/smoketest/repair/om-compact.robot
deleted file mode 100644
index 95f92ad3ce4..00000000000
--- a/hadoop-ozone/dist/src/main/smoketest/repair/om-compact.robot
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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 for OM DB Compaction Repair Tool
-Library             OperatingSystem
-Library             BuiltIn
-Resource            ../commonlib.robot
-Test Timeout        10 minutes
-
-*** Variables ***
-${OM_DB_PATH}       /data/metadata/om.db
-
-*** Keywords ***
-Delete Test Keys
-    Execute    ozone fs -rm -R -skipTrash ofs://${OM_SERVICE_ID}/vol1/bucket1
-
-Get OM DB SST Files Size
-    ${output} =    Execute    find ${OM_DB_PATH} -name '*.sst' -exec du -b {} 
+ | awk '{sum += $1} END {print sum}'
-    ${sst_size} =  Convert To Integer    ${output}
-    [Return]      ${sst_size}
-
-Compact OM DB Column Family
-    [Arguments]        ${column_family}
-    Execute    ozone repair om compact --cf=${column_family} --service-id 
${OM_SERVICE_ID} --node-id om1 --blc 2
-
-*** Test Cases ***
-Testing OM DB Size Reduction After Compaction
-    # Test keys are already created and flushed
-    # Delete keys to create tombstones that need compaction
-    Delete Test Keys
-    
-    ${size_before_compaction} =    Get OM DB SST Files Size
-
-    Compact OM DB Column Family    fileTable
-    Compact OM DB Column Family    deletedTable
-    Compact OM DB Column Family    deletedDirectoryTable
-    
-    ${size_after_compaction} =    Get OM DB SST Files Size
-
-    Should Be True    ${size_after_compaction} < ${size_before_compaction}
-    ...    OM DB size should be reduced after compaction. Before: 
${size_before_compaction}, After: ${size_after_compaction}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to