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

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


The following commit(s) were added to refs/heads/master by this push:
     new b725d3a  Improve the log message for lineage cleanup (#8066)
b725d3a is described below

commit b725d3a93f71c1d5d7a87981a4c81002d0929626
Author: Seunghyun Lee <[email protected]>
AuthorDate: Tue Jan 25 13:01:30 2022 -0800

    Improve the log message for lineage cleanup (#8066)
    
    - Improve the code to add the log only if the segments are deleted
---
 .../controller/helix/core/retention/RetentionManager.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/retention/RetentionManager.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/retention/RetentionManager.java
index a1679dc..d66d02d 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/retention/RetentionManager.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/retention/RetentionManager.java
@@ -24,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang.StringUtils;
 import org.apache.helix.ZNRecord;
 import org.apache.helix.model.IdealState;
 import org.apache.pinot.common.lineage.LineageEntry;
@@ -258,10 +257,11 @@ public class RetentionManager extends 
ControllerPeriodicTask<Void> {
         if (SegmentLineageAccessHelper
             
.writeSegmentLineage(_pinotHelixResourceManager.getPropertyStore(), 
segmentLineage, expectedVersion)) {
           // Delete segments based on the segment lineage
-          _pinotHelixResourceManager.deleteSegments(tableNameWithType, 
segmentsToDelete);
-          LOGGER.info("Finished cleaning up segment lineage for table: {}, 
deleted segments: {} in {}ms",
-              tableNameWithType, StringUtils.join(segmentsToDelete, ","),
-              (System.currentTimeMillis() - cleanupStartTime));
+          if (!segmentsToDelete.isEmpty()) {
+            _pinotHelixResourceManager.deleteSegments(tableNameWithType, 
segmentsToDelete);
+            LOGGER.info("Finished cleaning up segment lineage for table: {} in 
{}ms, deleted segments: {}",
+                tableNameWithType, (System.currentTimeMillis() - 
cleanupStartTime), segmentsToDelete);
+          }
           return true;
         } else {
           LOGGER.warn("Failed to write segment lineage back when cleaning up 
segment lineage for table: {}",

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to