hemantk-12 commented on code in PR #4949:
URL: https://github.com/apache/ozone/pull/4949#discussion_r1238975597
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -413,7 +412,22 @@ public void checkKey() throws Exception {
String snapshotKeyPrefix = createSnapshot(volumeName, bucketName);
- ozoneBucket.deleteKey(key1);
+
+ GenericTestUtils.waitFor(() -> {
+ try {
+ int keyCount = keyCount(ozoneBucket, key1);
+ if (keyCount == 0) {
+ return true;
+ }
+
+ ozoneBucket.deleteKey(key1);
Review Comment:
1.
> For some reason, sometimes two exactly the same keys (including names -
not sure if that is something that should happen) would be created in a bucket
even if intention was for a single key to be created.
It is surprising because that should not happen ideally. May be add random
numbers or char in dir and key name at line number 404 and 405.
2. Just a thought if it is because of soft delete? You can try following to
verify it.
```
ozoneBucket.deleteKey(key1);
GenericTestUtils.waitFor(() -> {
try {
return keyCount(ozoneBucket, key1) == 0;
} catch (Exception e) {
return false;
}
}, 1000, 10000);
```
--
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]