Copilot commented on code in PR #11872:
URL: https://github.com/apache/ozone/pull/11872#discussion_r4428595881
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java:
##########
@@ -472,6 +473,33 @@ private long getDurableUsedNamespace(String bucketKey) {
}
}
+ @Test
+ public void
testDirectoryCreatedAfterFailedCompleteIsPersistedWithItsParent() throws
Exception {
+ OzoneManager ozoneManager = cluster().getOzoneManager();
+ OMMetadataManager metadataManager = ozoneManager.getMetadataManager();
+ String parentDir = "parentOfFailedComplete";
+ TreeMap<Integer, String> partsMap = new TreeMap<>();
+ partsMap.put(1, "random");
+ OzoneManagerDoubleBuffer doubleBuffer =
+
ozoneManager.getOmRatisServer().getOmStateMachine().getOzoneManagerDoubleBuffer();
+
+ // Hold the flush so the directory is created while the failed complete is
still in the double buffer.
+ doubleBuffer.pause();
Review Comment:
Please drain the double buffer before pausing it: `pause()` does not stop a
flush iteration that has already passed the pause check. If a setup transaction
is still pending, that iteration can also flush the failed completion and evict
its provisional parents before `createDirectory()`, allowing this regression
test to pass without the fix. Call `ozoneManager.awaitDoubleBufferFlush()`
before `pause()`, following the drain-then-pause pattern in
`TestDirectoryDeletingServiceWithFSO.java:475–476`.
--
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]