You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "arunsarin85 (via GitHub)" <gi...@apache.org> on 2026/05/06 10:14:59 UTC
[PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
arunsarin85 opened a new pull request, #10200:
URL: https://github.com/apache/ozone/pull/10200
## What changes were proposed in this pull request?
- Add snapshot/snapshot-defrag.robot: Robot Framework tests that exercise snapshot behavior while the OM is configured for periodic snapshot defrag in the unsecure compose/ozone environment.
- Enable ozone.snapshot.defrag.service.interval only on the OM service in docker-compose.yaml
Please describe your PR in detail:
snapshot defrag basics from the user-visible side: reads, listing, diff, and delete, with waits so background defrag can run.
Scenarios in snapshot-defrag.robot (8 tests):
1. Read snapshot data right after create - New snapshot’s .snapshot path matches the file that was stored (/etc/hosts).
2. After waiting, snapshot and live bucket still match - Add another key on the live bucket, wait ~65s, then the first snapshot still has the old content and the live key matches /etc/passwd.
3. Snapshot list still shows active - ozone sh snapshot ls lists the snapshot and SNAPSHOT_ACTIVE.
4. Second snapshot sees all keys so far - Third key + second snapshot; older snapshot still only reflects the first key; newer snapshot can read all three keys.
5. snapshot diff starts a new job - CLI diff between the two snapshots shows the usual “new job” / --get-report messaging.
6. snapshot diff JSON lists added keys - --get-report --json completes with DONE and lists the keys that appeared after the first snapshot.
7. Same JSON diff after another wait - Second ~65s wait, then run the JSON diff again and still expect the same key paths in the report (stability after more defrag time).
8. Delete older snapshot, younger one still readable - Delete the first snapshot; listing shows SNAPSHOT_DELETED; keys are still readable through the second snapshot path.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15181
## How was this patch tested?
Robot / Docker: execute_robot_test scm snapshot/snapshot-defrag.robot against hadoop-ozone/dist/target/ozone-*/compose/ozone after mvn clean package -DskipTests -Pdist (correct /opt/hadoop mount).
<img width="802" height="377" alt="image" src="https://github.com/user-attachments/assets/9b97c2d3-b288-48b8-9f93-a764a56f4b37" />
[robot-001.xml](https://github.com/user-attachments/files/27434987/robot-001.xml)
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "arunsarin85 (via GitHub)" <gi...@apache.org>.
arunsarin85 commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3204099508
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,106 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval on the OM only
+... (compose/ozone docker-compose).
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+Snapshot Diff Json Unchanged After Another Defrag Wait
+ [Documentation] Run the same JSON diff again after waiting again; the reported key paths should still be there.
+ Sleep ${DEFRAG_WAIT_SECONDS}
Review Comment:
@smengcl Followed the below approach instead of checking DB/YAML metadata.
Wait a bit longer for defrag again, then run ozone sh snapshot info on both snapshots and re-read the keys through .snapshot. That still checks that OM reports the snapshots as healthy and that reads keep working after more defrag time.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3197504108
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,106 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval on the OM only
+... (compose/ozone docker-compose).
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+Snapshot Diff Json Unchanged After Another Defrag Wait
Review Comment:
Is the intention of this test to retrigger the snapshot diff?
By default the result of snapshot diff is persisted for a while, so a rerun without clearing previous result won't actually retrigger the diff (see `ozone.om.snapshot.diff.job.report.persistent.time`)
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Robot test for snapshot defrag [ozone]
Posted by "arunsarin85 (via GitHub)" <gi...@apache.org>.
arunsarin85 commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3218145070
##########
hadoop-ozone/dist/src/main/compose/ozone/test.sh:
##########
@@ -55,4 +55,6 @@ execute_robot_test scm -v SCHEME:ofs -N ozonefs-obs ozonefs/ozonefs-obs.robot
execute_robot_test s3g grpc/grpc-om-s3-metrics.robot
-execute_robot_test scm --exclude pre-finalized-snapshot-tests snapshot
+execute_robot_test scm --exclude om_filesystem --exclude pre-finalized-snapshot-tests snapshot
+
+execute_robot_test om snapshot/snapshot-defrag.robot
Review Comment:
Yes the tests needs to verify the OmSnapshot local YAML files from the OM .
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3197206102
##########
hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml:
##########
@@ -41,6 +41,8 @@ services:
<<: *common-config
environment:
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
+ # OM-only: periodic snapshot defrag for smoketest snapshot/snapshot-defrag.robot (HDDS-15181)
+ OZONE-SITE.XML_ozone.snapshot.defrag.service.interval: 30s
Review Comment:
We should put this in ./compose/ozone/docker-config instead. e.g.:
https://github.com/arunsarin85/ozone/blob/aae498c66ef25c669854c203b1aa294825596fce/hadoop-ozone/dist/src/main/compose/ozone/docker-config#L44
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "arunsarin85 (via GitHub)" <gi...@apache.org>.
arunsarin85 commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3204111023
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,106 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval on the OM only
+... (compose/ozone docker-compose).
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+Snapshot Diff Json Unchanged After Another Defrag Wait
Review Comment:
@smengcl Thanks for pointing .
Agreed ! (Running --get-report again wouldn’t really run the diff again; it would mostly show the same saved report for a while.)
I removed that second JSON diff. We still do one full JSON report after submitting the diff (to check it finishes and lists the right keys). After the extra wait we now rely on snapshot info plus reading the keys again, so we’re not implying we recomputed the diff.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3197474781
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,106 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval on the OM only
+... (compose/ozone docker-compose).
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+Snapshot Diff Json Unchanged After Another Defrag Wait
+ [Documentation] Run the same JSON diff again after waiting again; the reported key paths should still be there.
+ Sleep ${DEFRAG_WAIT_SECONDS}
Review Comment:
It can better confirm that defrag has been done by checking DB / yaml metadata.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Robot test for snapshot defrag [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #10200:
URL: https://github.com/apache/ozone/pull/10200#issuecomment-4422934299
Thanks @arunsarin85 for the patch, @smengcl for the review.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Robot test for snapshot defrag [ozone]
Posted by "arunsarin85 (via GitHub)" <gi...@apache.org>.
arunsarin85 commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3218132876
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,170 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval in compose/ozone
+... docker-config. Default compose has one datanode: use replication 1 (OZONE_REPLICATION_FACTOR)
+... or scale datanodes to match replication.
Review Comment:
Thanks for pointing out . This was old doc strings from initial draft version forgot to correct it . I have updated the doc strings.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Robot test for snapshot defrag [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #10200:
URL: https://github.com/apache/ozone/pull/10200
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "arunsarin85 (via GitHub)" <gi...@apache.org>.
arunsarin85 commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3204068723
##########
hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml:
##########
@@ -41,6 +41,8 @@ services:
<<: *common-config
environment:
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
+ # OM-only: periodic snapshot defrag for smoketest snapshot/snapshot-defrag.robot (HDDS-15181)
+ OZONE-SITE.XML_ozone.snapshot.defrag.service.interval: 30s
Review Comment:
Thanks! moved ozone.snapshot.defrag.service.interval to compose/ozone/docker-config
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3204664786
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,124 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval in compose/ozone
+... docker-config. Default compose has one datanode: use replication 1 (OZONE_REPLICATION_FACTOR)
+... or scale datanodes to match replication.
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+After More Defrag Time Snapshot Info And Reads Stay Consistent
+ [Documentation] Wait again so defrag can run. Re-check ozone sh snapshot info (OM metadata includes
+ ... checkpointDir / status) and re-read keys through snapshot paths. We do not rerun snapshot
+ ... diff --get-report here: a completed diff report is served from cache for
+ ... ozone.om.snapshot.diff.job.report.persistent.time, so that call would not retrigger work.
+ Sleep ${DEFRAG_WAIT_SECONDS}
Review Comment:
Could you add a step around here to check the YAML to confirm defrag completion, something like this:
```
*** Keywords ***
Get Snapshot Local YAML Path
[Arguments] ${snapshot_name}
${info} = Execute ozone sh snapshot info /${VOLUME}/${BUCKET} ${snapshot_name}
${snapshot_id} = Execute echo '${info}' | jq -r '.snapshotId'
[Return] /data/metadata/db.snapshots/checkpointState/om.db-${snapshot_id}.yaml
Snapshot Local YAML Should Show Defragged
[Arguments] ${snapshot_name}
${yaml} = Get Snapshot Local YAML Path ${snapshot_name}
Execute test -f ${yaml}
${version} = Execute awk '/^version:/ {print $2}' ${yaml}
${needs_defrag} = Execute awk '/^needsDefrag:/ {print $2}' ${yaml}
Should Be True ${version} > 0
Should Be Equal ${needs_defrag} false
```
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3204667710
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,124 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval in compose/ozone
+... docker-config. Default compose has one datanode: use replication 1 (OZONE_REPLICATION_FACTOR)
+... or scale datanodes to match replication.
+Library OperatingSystem
+Resource ../ozone-lib/shell.robot
+Resource snapshot-setup.robot
+Suite Setup Prepare Suite With Bucket And First Snapshot
+Test Timeout 20 minutes
+
+*** Variables ***
+# Wait long enough for at least two defrag runs (OM uses a 30s interval in compose).
+${DEFRAG_WAIT_SECONDS} 65
+
+*** Test Cases ***
+Read Snapshot Data Right After Create
+ [Documentation] You can read the snapshotted key from the .snapshot path as soon as the snapshot exists.
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+
+After Waiting Keys Still Match Through Snapshot And On Live Bucket
+ [Documentation] Add a new key on the live bucket, wait so defrag may run, then confirm the snapshot
+ ... still has the old file and the live bucket has the new one.
+ ${key_two} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/passwd
+ Set Suite Variable ${KEY_TWO} ${key_two}
+ Set Suite Variable ${LIVE_KEY_TWO_PATH} /${VOLUME}/${BUCKET}/${key_two}
+ Sleep ${DEFRAG_WAIT_SECONDS}
+ Key Should Match Local File ${SNAP_KEY_PATH_ONE} /etc/hosts
+ Key Should Match Local File ${LIVE_KEY_TWO_PATH} /etc/passwd
+
+Snapshot List Still Shows Active
+ [Documentation] ozone sh snapshot ls still lists this snapshot as SNAPSHOT_ACTIVE.
+ ${result} = Execute ozone sh snapshot ls /${VOLUME}/${BUCKET}
+ Should contain ${result} ${SNAPSHOT_ONE}
+ Should contain ${result} SNAPSHOT_ACTIVE
+
+Second Snapshot Sees All Keys So Far
+ [Documentation] Take another snapshot after adding a third key; older snapshot still only has the first key;
+ ... newer snapshot can read all three keys.
+ ${key_three} = snapshot-setup.Create key ${VOLUME} ${BUCKET} /etc/group
+ Set Suite Variable ${KEY_THREE} ${key_three}
+ ${snapshot_two} = Create snapshot ${VOLUME} ${BUCKET}
+ Set Suite Variable ${SNAPSHOT_TWO} ${snapshot_two}
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_ONE}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_ONE} /etc/hosts
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_TWO} /etc/passwd
+ Key Should Match Local File /${VOLUME}/${BUCKET}/${SNAPSHOT_INDICATOR}/${SNAPSHOT_TWO}/${KEY_THREE} /etc/group
+
+Snapshot Diff Starts A New Job
+ [Documentation] Comparing the two snapshots prints the usual “new job” and --get-report hint (like snapshot-sh.robot).
+ ${result} = Execute ozone sh snapshot diff /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain ${result} Submitting a new job
+ Should contain ${result} --get-report option
+
+Snapshot Diff Json Report Lists Added Keys
+ [Documentation] Full JSON report finishes with DONE and lists the keys that appeared after the first snapshot.
+ ${result} = Execute ozone sh snapshot diff --get-report --json /${VOLUME}/${BUCKET} ${SNAPSHOT_ONE} ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.jobStatus' DONE
+ Should contain echo '${result}' | jq '.snapshotDiffReport.volumeName' ${VOLUME}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.bucketName' ${BUCKET}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.fromSnapshot' ${SNAPSHOT_ONE}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.toSnapshot' ${SNAPSHOT_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_TWO}
+ Should contain echo '${result}' | jq '.snapshotDiffReport.diffList | .[].sourcePath' ${KEY_THREE}
+
+After More Defrag Time Snapshot Info And Reads Stay Consistent
+ [Documentation] Wait again so defrag can run. Re-check ozone sh snapshot info (OM metadata includes
+ ... checkpointDir / status) and re-read keys through snapshot paths. We do not rerun snapshot
+ ... diff --get-report here: a completed diff report is served from cache for
+ ... ozone.om.snapshot.diff.job.report.persistent.time, so that call would not retrigger work.
+ Sleep ${DEFRAG_WAIT_SECONDS}
Review Comment:
Actually with this, you can poll rather than waiting for fixed amount of time, so as to make the test finish quicker.
--
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: issues-unsubscribe@ozone.apache.org
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
Re: [PR] HDDS-15181. Added Robot smoketests for snapshot defrag on single-node compose [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #10200:
URL: https://github.com/apache/ozone/pull/10200#discussion_r3218048838
##########
hadoop-ozone/dist/src/main/smoketest/snapshot/snapshot-defrag.robot:
##########
@@ -0,0 +1,170 @@
+# 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 Basic checks that snapshots still look correct while the OM runs periodic
+... snapshot defrag in the background (Jira HDDS-15181 / parent HDDS-13003).
+... Cluster setup: filesystem snapshots on; defrag interval in compose/ozone
+... docker-config. Default compose has one datanode: use replication 1 (OZONE_REPLICATION_FACTOR)
+... or scale datanodes to match replication.
Review Comment:
note: the test is run with 3 datanodes
##########
hadoop-ozone/dist/src/main/compose/ozone/test.sh:
##########
@@ -55,4 +55,6 @@ execute_robot_test scm -v SCHEME:ofs -N ozonefs-obs ozonefs/ozonefs-obs.robot
execute_robot_test s3g grpc/grpc-om-s3-metrics.robot
-execute_robot_test scm --exclude pre-finalized-snapshot-tests snapshot
+execute_robot_test scm --exclude om_filesystem --exclude pre-finalized-snapshot-tests snapshot
+
+execute_robot_test om snapshot/snapshot-defrag.robot
Review Comment:
Does `snapshot-defrag.robot` assume it is running locally on OM?
--
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: issues-unsubscribe@ozone.apache.org
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