From b97ad6d3ca4cf15117a0aef94a73b18124b16fe0 Mon Sep 17 00:00:00 2001 From: Davis Zhang Date: Fri, 3 Jan 2025 12:13:23 -0800 Subject: [PATCH 1/2] fix bad log info --- .../java/org/apache/hudi/client/BaseHoodieWriteClient.java | 7 ++++--- .../client/timeline/versioning/v1/TimelineArchiverV1.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java index c58181eab45f..783ae17e9386 100644 --- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java +++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java @@ -573,7 +573,7 @@ protected void mayBeCleanAndArchive(HoodieTable table) { autoCleanOnCommit(); autoArchiveOnCommit(table); } catch (Throwable t) { - LOG.error(String.format("Inline cleaning or clustering failed for {}", table.getConfig().getBasePath()), t); + LOG.error("Inline cleaning or clustering failed for {}", table.getConfig().getBasePath(), t); throw t; } } @@ -584,12 +584,13 @@ protected void runTableServicesInline(HoodieTable table, HoodieCommitMetadata me // do this outside of lock since compaction, clustering can be time taking and we don't need a lock for the entire execution period runTableServicesInlineInternal(table, metadata, extraMetadata); } catch (Throwable t) { - LOG.error(String.format("Inline compaction or clustering failed for table {}.", table.getConfig().getBasePath()), t); // Throw if this is exception and the exception is configured to throw or if it is something else like Error. if (config.isFailOnInlineTableServiceExceptionEnabled() || !(t instanceof Exception)) { + LOG.error("Inline compaction or clustering failed for table {}.", table.getConfig().getBasePath(), t); throw t; } - LOG.warn("Inline compaction or clustering failed. Moving further since \"hoodie.fail.writes.on.inline.table.service.exception\" is set to false.", t); + LOG.warn("Inline compaction or clustering failed table {}. Moving further since " + + "\"hoodie.fail.writes.on.inline.table.service.exception\" is set to false.", table.getConfig().getBasePath(), t); } } diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/versioning/v1/TimelineArchiverV1.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/versioning/v1/TimelineArchiverV1.java index 9672169e5b24..c34b7ccb9dea 100644 --- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/versioning/v1/TimelineArchiverV1.java +++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/versioning/v1/TimelineArchiverV1.java @@ -143,7 +143,7 @@ public int archiveIfRequired(HoodieEngineContext context, boolean acquireLock) t List instantsToArchive = getInstantsToArchive(); if (!instantsToArchive.isEmpty()) { this.writer = openWriter(archiveFilePath.getParent()); - LOG.info(String.format("Archiving instants {} for table {}", instantsToArchive, config.getBasePath())); + LOG.info("Archiving instants {} for table {}", instantsToArchive, config.getBasePath()); archive(context, instantsToArchive); LOG.info("Deleting archived instants {} for table {}", instantsToArchive, config.getBasePath()); deleteArchivedInstants(instantsToArchive, context); From 8d40fddb50052a27757c23655881243a0c6861f9 Mon Sep 17 00:00:00 2001 From: Y Ethan Guo Date: Fri, 3 Jan 2025 15:56:29 -0800 Subject: [PATCH 2/2] Update hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java --- .../main/java/org/apache/hudi/client/BaseHoodieWriteClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java index 783ae17e9386..ab80db685720 100644 --- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java +++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java @@ -589,7 +589,7 @@ protected void runTableServicesInline(HoodieTable table, HoodieCommitMetadata me LOG.error("Inline compaction or clustering failed for table {}.", table.getConfig().getBasePath(), t); throw t; } - LOG.warn("Inline compaction or clustering failed table {}. Moving further since " + LOG.warn("Inline compaction or clustering failed for table {}. Moving further since " + "\"hoodie.fail.writes.on.inline.table.service.exception\" is set to false.", table.getConfig().getBasePath(), t); } }