TheR1sing3un commented on code in PR #12389:
URL: https://github.com/apache/hudi/pull/12389#discussion_r1881602169
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/ConsistentBucketIndexUtils.java:
##########
@@ -184,12 +184,31 @@ public static boolean saveMetadata(HoodieTable table,
HoodieConsistentHashingMet
StoragePath dir = FSUtils.constructAbsolutePath(
table.getMetaClient().getHashingMetadataPath(),
metadata.getPartitionPath());
StoragePath fullPath = new StoragePath(dir, metadata.getFilename());
+ byte[] bytes;
try {
- storage.createImmutableFileInPath(fullPath,
Option.of(metadata.toBytes()));
- return true;
+ bytes = metadata.toBytes();
} catch (IOException e) {
+ LOG.error("Error when converting hashing metadata: {} to bytes",
metadata.getPartitionPath(), e);
+ throw new HoodieIndexException("Error while converting hashing metadata
to bytes", e);
+ }
+ try {
+ storage.createImmutableFileInPath(fullPath, Option.of(bytes));
+ return true;
+ } catch (HoodieIOException e) {
LOG.warn("Failed to update bucket metadata: " + metadata, e);
- return false;
+ boolean exist;
+ try {
+ exist = storage.exists(fullPath);
Review Comment:
still return success for creating failed but the target file already exists.
--
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]