This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 25e06f2bce [core] Add more commit info logs (#5657)
25e06f2bce is described below

commit 25e06f2bce707afd03ff99f519af3891da4c80b1
Author: Zouxxyy <[email protected]>
AuthorDate: Sat May 24 10:42:58 2025 +0800

    [core] Add more commit info logs (#5657)
---
 .../paimon/operation/FileStoreCommitImpl.java      | 47 ++++++++++++++++++----
 .../apache/paimon/table/ExpireSnapshotsImpl.java   | 13 +++---
 2 files changed, 48 insertions(+), 12 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
index ee672f4ac6..7046d970a4 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java
@@ -269,6 +269,10 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
             ManifestCommittable committable,
             Map<String, String> properties,
             boolean checkAppendFiles) {
+        LOG.info(
+                "Ready to commit to table {}, number of commit messages: {}",
+                tableName,
+                committable.fileCommittables().size());
         if (LOG.isDebugEnabled()) {
             LOG.debug("Ready to commit\n{}", committable.toString());
         }
@@ -368,6 +372,7 @@ public class FileStoreCommitImpl implements FileStoreCommit 
{
             }
         } finally {
             long commitDuration = (System.nanoTime() - started) / 1_000_000;
+            LOG.info("Finished commit to table {}, duration {} ms", tableName, 
commitDuration);
             if (this.commitMetrics != null) {
                 reportCommit(
                         appendTableFiles,
@@ -406,6 +411,10 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
             Map<String, String> partition,
             ManifestCommittable committable,
             Map<String, String> properties) {
+        LOG.info(
+                "Ready to overwrite to table {}, number of commit messages: 
{}",
+                tableName,
+                committable.fileCommittables().size());
         if (LOG.isDebugEnabled()) {
             LOG.debug(
                     "Ready to overwrite partition {}\nManifestCommittable: 
{}\nProperties: {}",
@@ -513,6 +522,7 @@ public class FileStoreCommitImpl implements FileStoreCommit 
{
             }
         } finally {
             long commitDuration = (System.nanoTime() - started) / 1_000_000;
+            LOG.info("Finished overwrite to table {}, duration {} ms", 
tableName, commitDuration);
             if (this.commitMetrics != null) {
                 reportCommit(
                         appendTableFiles,
@@ -701,6 +711,28 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
                                 }
                             });
         }
+        if (!commitMessages.isEmpty()) {
+            List<String> msg = new ArrayList<>();
+            if (appendTableFiles.size() > 0) {
+                msg.add(appendTableFiles.size() + " append table files");
+            }
+            if (appendChangelog.size() > 0) {
+                msg.add(appendChangelog.size() + " append Changelogs");
+            }
+            if (compactTableFiles.size() > 0) {
+                msg.add(compactTableFiles.size() + " compact table files");
+            }
+            if (compactChangelog.size() > 0) {
+                msg.add(compactChangelog.size() + " compact Changelogs");
+            }
+            if (appendHashIndexFiles.size() > 0) {
+                msg.add(appendHashIndexFiles.size() + " append hash index 
files");
+            }
+            if (compactDvIndexFiles.size() > 0) {
+                msg.add(compactDvIndexFiles.size() + " compact dv index 
files");
+            }
+            LOG.info("Finished collecting changes, including: {}", 
String.join(", ", msg));
+        }
     }
 
     private ManifestEntry makeEntry(FileKind kind, CommitMessage 
commitMessage, DataFileMeta file) {
@@ -1013,13 +1045,14 @@ public class FileStoreCommitImpl implements 
FileStoreCommit {
         }
 
         if (commitSnapshotImpl(newSnapshot, deltaStatistics)) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug(
-                        String.format(
-                                "Successfully commit snapshot #%d by user %s "
-                                        + "with identifier %s and kind %s.",
-                                newSnapshotId, commitUser, identifier, 
commitKind.name()));
-            }
+            LOG.info(
+                    "Successfully commit snapshot {} to table {} by user {} "
+                            + "with identifier {} and kind {}.",
+                    newSnapshotId,
+                    tableName,
+                    commitUser,
+                    identifier,
+                    commitKind.name());
             commitCallbacks.forEach(callback -> callback.call(deltaFiles, 
newSnapshot));
             return new SuccessResult();
         }
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java 
b/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java
index 4e6a1f87da..5560b7a82e 100644
--- a/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java
+++ b/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java
@@ -135,6 +135,8 @@ public class ExpireSnapshotsImpl implements ExpireSnapshots 
{
 
     @VisibleForTesting
     public int expireUntil(long earliestId, long endExclusiveId) {
+        long startTime = System.currentTimeMillis();
+
         if (endExclusiveId <= earliestId) {
             // No expire happens:
             // write the hint file in order to see the earliest snapshot 
directly next time
@@ -158,11 +160,6 @@ public class ExpireSnapshotsImpl implements 
ExpireSnapshots {
             }
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(
-                    "Snapshot expire range is [" + beginInclusiveId + ", " + 
endExclusiveId + ")");
-        }
-
         List<Snapshot> taggedSnapshots = tagManager.taggedSnapshots();
 
         // delete merge tree files
@@ -269,6 +266,12 @@ public class ExpireSnapshotsImpl implements 
ExpireSnapshots {
         }
 
         writeEarliestHint(endExclusiveId);
+        long duration = System.currentTimeMillis() - startTime;
+        LOG.info(
+                "Finished expire snapshots, duration {} ms, range is [{}, {})",
+                duration,
+                beginInclusiveId,
+                endExclusiveId);
         return (int) (endExclusiveId - beginInclusiveId);
     }
 

Reply via email to