Tejaskriya commented on code in PR #8613:
URL: https://github.com/apache/ozone/pull/8613#discussion_r2152118833
##########
hadoop-ozone/dist/src/main/compose/common/replicas-test.sh:
##########
@@ -21,33 +21,47 @@ volume="cli-debug-volume${prefix}"
bucket="cli-debug-bucket"
key="testfile"
+dn_container="ozonesecure-ha-datanode1-1"
+container_db_path="/data/hdds/hdds/"
+local_db_backup_path="${COMPOSE_DIR}/container_db_backup"
+mkdir -p "${local_db_backup_path}"
+
+echo "Taking a backup of container.db"
+docker exec "${dn_container}" find "${container_db_path}" -name "container.db"
| while read -r db; do
+ docker cp "${dn_container}:${db}" "${local_db_backup_path}/container.db"
+done
+
execute_robot_test ${SCM} -v "PREFIX:${prefix}" debug/ozone-debug-tests.robot
-#TODO HDDS-12890: Add acceptance robot tests for ozone debug replicas verify
# get block locations for key
-#chunkinfo="${key}-blocks-${prefix}"
-#docker-compose exec -T ${SCM} bash -c "ozone debug replicas chunk-info
${volume}/${bucket}/${key}" > "$chunkinfo"
-#host="$(jq -r '.KeyLocations[0][0]["Datanode-HostName"]' ${chunkinfo})"
-#container="${host%%.*}"
-#
-## corrupt the first block of key on one of the datanodes
-#datafile="$(jq -r '.KeyLocations[0][0].Locations.files[0]' ${chunkinfo})"
-#docker exec "${container}" sed -i -e '1s/^/a/' "${datafile}"
-#
-#execute_robot_test ${SCM} -v "PREFIX:${prefix}" -v "CORRUPT_DATANODE:${host}"
debug/ozone-debug-corrupt-block.robot
-#
-#docker stop "${container}"
-#
-#wait_for_datanode "${container}" STALE 60
-#execute_robot_test ${SCM} -v "PREFIX:${prefix}" -v "STALE_DATANODE:${host}"
debug/ozone-debug-stale-datanode.robot
-#
-#wait_for_datanode "${container}" DEAD 60
-#execute_robot_test ${SCM} -v "PREFIX:${prefix}"
debug/ozone-debug-dead-datanode.robot
-#
-#docker start "${container}"
-#
-#wait_for_datanode "${container}" HEALTHY 60
+chunkinfo="${key}-blocks-${prefix}"
+docker-compose exec -T ${SCM} bash -c "ozone debug replicas chunk-info
${volume}/${bucket}/${key}" > "$chunkinfo"
+host="$(jq -r '.keyLocations[0][0].datanode["hostname"]' ${chunkinfo})"
+container="${host%%.*}"
+
+# corrupt the first block of key on one of the datanodes
+datafile="$(jq -r '.keyLocations[0][0].file' ${chunkinfo})"
+docker exec "${container}" sed -i -e '1s/^/a/' "${datafile}"
+
+execute_robot_test ${SCM} -v "PREFIX:${prefix}" -v "CORRUPT_DATANODE:${host}"
debug/corrupt-block-checksum.robot
+
+echo "Overwriting container.db with the backup db"
+target_container_dir=$(docker exec "${container}" find "${container_db_path}"
-name "container.db" | xargs dirname)
+docker cp "${local_db_backup_path}/container.db"
"${container}:${target_container_dir}/"
+docker exec "${container}" sudo chown -R hadoop:hadoop
"${target_container_dir}"
+
+docker stop "${container}"
+
+wait_for_datanode "${container}" STALE 60
+execute_robot_test ${SCM} -v "PREFIX:${prefix}" -v "STALE_DATANODE:${host}"
debug/stale-datanode-checksum.robot
+
+wait_for_datanode "${container}" DEAD 60
Review Comment:
We aren't performing any test after making the datanode dead. Earlier we had
a test for this, which has been removed.
Any reason for this?
Otherwise we can add coverage for dead nodes as well.
##########
hadoop-ozone/dist/src/main/smoketest/debug/block-existence-check.robot:
##########
@@ -14,21 +14,22 @@
# limitations under the License.
*** Settings ***
-Documentation Test checksums in case of one datanode is dead
+Documentation Test block existence in case a block does not exist
Review Comment:
```suggestion
Documentation Test existence of a block on a datanode
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]