sarvekshayr commented on code in PR #8941:
URL: https://github.com/apache/ozone/pull/8941#discussion_r2284081987
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot:
##########
@@ -47,3 +58,46 @@ Test ozone debug replicas verify checksums
Test ozone debug version
${output} = Execute ozone debug version
Review Comment:
Keep all related tests together. Therefore place `Test ozone debug version`
towards the end.
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot:
##########
@@ -27,13 +28,23 @@ ${VOLUME} cli-debug-volume${PREFIX}
${BUCKET} cli-debug-bucket
${DEBUGKEY} debugKey
${TESTFILE} testfile
+${RATIS_ONE_KEY} ratis-one-key
+${RATIS_THREE_KEY} ratis-three-key
+${EC_KEY} ec-key
*** Keywords ***
Write keys
Execute ozone sh volume create o3://${OM_SERVICE_ID}/${VOLUME}
--space-quota 100TB --namespace-quota 100
Execute ozone sh bucket create
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET} --space-quota 1TB
Execute dd if=/dev/urandom of=${TEMP_DIR}/${TESTFILE}
bs=100000 count=15
+ # Create default key (RATIS THREE by default)
Execute ozone sh key put
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET}/${TESTFILE} ${TEMP_DIR}/${TESTFILE}
+ # Create RATIS ONE key
+ Create test key with replication config ${RATIS_ONE_KEY} RATIS
ONE
+ # Create RATIS THREE key
+ Create test key with replication config ${RATIS_THREE_KEY} RATIS
THREE
+ # Create EC key (rs-3-2-1024k)
+ Create test key with replication config ${EC_KEY} EC
rs-3-2-1024k
*** Test Cases ***
Test ozone debug replicas verify checksums
Review Comment:
This is not related to your change but I noticed that the title does not
include all verification flags. Please include them.
```suggestion
Test ozone debug replicas verify checksums, block-existence and
container-state
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java:
##########
@@ -216,6 +228,26 @@ void processKey(OzoneClient ozoneClient, String
volumeName, String bucketName, S
}
}
+ /**
+ * Check if the key should be processed based on replication config.
+ * @param keyInfo the key to check
+ * @return true if the key should be processed, false if it should be skipped
+ */
+ private boolean shouldProcessKeyByReplicationType(OmKeyInfo keyInfo) {
+ Optional<ReplicationConfig> filterConfig =
replication.fromParams(getConf());
+ if (!filterConfig.isPresent()) {
+ // No filter specified, include all keys
+ return true;
+ }
+
+ ReplicationConfig keyReplicationConfig = keyInfo.getReplicationConfig();
+ ReplicationConfig filter = filterConfig.get();
+
+ // Process key only if both replication type and factor/config match
Review Comment:
```suggestion
// Process key only if both replication type and factor match
```
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot:
##########
@@ -47,3 +58,46 @@ Test ozone debug replicas verify checksums
Test ozone debug version
${output} = Execute ozone debug version
Execute echo '${output}' | jq -r '.' # validate JSON
+
+Test ozone debug replicas verify with RATIS ONE filter
+ ${output} = Execute replicas verify with replication filter RATIS
ONE checksums
+ ${json} = Parse replicas verify JSON output ${output}
+
+ # Should only contain RATIS ONE key
Review Comment:
Please move this comment above
```
Verify key exists in output ${json} ${RATIS_ONE_KEY}
```
Follow the same for other two test cases as well.
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-keywords.robot:
##########
@@ -65,3 +65,37 @@ Check Replica Passed
Should Be True ${check['completed']}
Should Be True ${check['pass']}
Should Be Empty ${check['failures']}
+
+Execute replicas verify with replication filter
+ [Arguments] ${replication_type} ${replication_factor}
${verification_type}
+ ${output} Execute ozone debug replicas verify
--${verification_type} --type ${replication_type} --replication
${replication_factor} o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET} --all-results
+ [Return] ${output}
+
+Execute replicas verify with replication type only
Review Comment:
Since we don't use this keyword, it can be removed.
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot:
##########
@@ -27,13 +28,23 @@ ${VOLUME} cli-debug-volume${PREFIX}
${BUCKET} cli-debug-bucket
${DEBUGKEY} debugKey
${TESTFILE} testfile
+${RATIS_ONE_KEY} ratis-one-key
+${RATIS_THREE_KEY} ratis-three-key
+${EC_KEY} ec-key
*** Keywords ***
Write keys
Execute ozone sh volume create o3://${OM_SERVICE_ID}/${VOLUME}
--space-quota 100TB --namespace-quota 100
Execute ozone sh bucket create
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET} --space-quota 1TB
Execute dd if=/dev/urandom of=${TEMP_DIR}/${TESTFILE}
bs=100000 count=15
+ # Create default key (RATIS THREE by default)
Execute ozone sh key put
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET}/${TESTFILE} ${TEMP_DIR}/${TESTFILE}
+ # Create RATIS ONE key
+ Create test key with replication config ${RATIS_ONE_KEY} RATIS
ONE
+ # Create RATIS THREE key
+ Create test key with replication config ${RATIS_THREE_KEY} RATIS
THREE
+ # Create EC key (rs-3-2-1024k)
Review Comment:
```suggestion
# Create EC rs-3-2-1024k key
```
--
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]