jonvex commented on code in PR #10836:
URL: https://github.com/apache/hudi/pull/10836#discussion_r1517067137
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/ConsistentBucketIndexUtils.java:
##########
@@ -210,7 +210,15 @@ private static void createCommitMarker(HoodieTable table,
Path fileStatus, Path
if (fs.exists(fullPath)) {
return;
}
- FileIOUtils.createFileInPath(fs, fullPath,
Option.of(getUTF8Bytes(StringUtils.EMPTY_STRING)));
+ //prevent exception from race condition. We are ok with the file being
created in another thread, so we should
+ // check for the marker after catching the exception and we don't need to
fail if the file exists
+ try {
+ FileIOUtils.createFileInPath(fs, fullPath,
Option.of(getUTF8Bytes(StringUtils.EMPTY_STRING)));
+ } catch (HoodieIOException e) {
+ if (!fs.exists(fullPath)) {
+ throw e;
+ }
+ }
Review Comment:
@beyond1920 can you please take a look at this? Thanks!
--
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]