You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by am...@apache.org on 2023/05/19 13:50:35 UTC

[jackrabbit-oak] branch trunk updated: OAK-10249: Reduce logging in the datastore check and gc process (#945)

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

amitj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9da4894b8c OAK-10249: Reduce logging in the datastore check and gc process (#945)
9da4894b8c is described below

commit 9da4894b8cc75fcb7929c77b4e4e68e9a2c8c80e
Author: Amit Jain <am...@apache.org>
AuthorDate: Fri May 19 19:20:29 2023 +0530

    OAK-10249: Reduce logging in the datastore check and gc process (#945)
    
    - only log sizes for individual files to debug
    - log blob ids only at 100k
    - ignore in memory blobs as anyways not relevant
---
 .../apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java | 4 ++--
 .../src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java
index 99987cd99f..ccd6eebb05 100644
--- a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java
+++ b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java
@@ -421,7 +421,7 @@ public class MarkSweepGarbageCollector implements BlobGarbageCollector {
             lineIterator.forEachRemaining(line -> {
                 String id = line.split(DELIM)[0];
                 long length = DataStoreBlobStore.BlobId.of(id).getLength();
-                LOG.info("Blob {} has size {}", id, length);
+                LOG.debug("Blob {} has size {}", id, length);
 
                 stats.getCollector().updateNumBlobReferences(1);
 
@@ -662,7 +662,7 @@ public class MarkSweepGarbageCollector implements BlobGarbageCollector {
                                     saveBatchToFile(idBatch, writer);
                                 }
 
-                                if (count.get() % getBatchCount() == 0) {
+                                if (count.get() > 0 && count.get() % getBatchCount() == 0) {
                                     LOG.info("Collected ({}) blob references", count.get());
                                 }
                             } catch (Exception e) {
diff --git a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
index e0143a1994..fa820815d0 100644
--- a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
+++ b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
@@ -257,7 +257,7 @@ public final class FileIOUtils {
                 writeAsLine(writer, transformer.apply(iterator.next()), escape);
                 count++;
                 if (logger != null) {
-                    if (count % 1000 == 0) {
+                    if (count % 100000 == 0) {
                         logger.info(Strings.nullToEmpty(message) + count);
                     }
                 }