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 10:42:34 UTC

[jackrabbit-oak] branch OAK-10249 created (now db94c4dad5)

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

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


      at db94c4dad5 OAK-10249: Reduce logging in the datastore check and gc process

This branch includes the following new commits:

     new db94c4dad5 OAK-10249: Reduce logging in the datastore check and gc process

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[jackrabbit-oak] 01/01: OAK-10249: Reduce logging in the datastore check and gc process

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit db94c4dad5d7b0d737dae54d1a1aa3416e0c927f
Author: amjain <am...@adobe.com>
AuthorDate: Fri May 19 14:07:49 2023 +0530

    OAK-10249: Reduce logging in the datastore check and gc process
    
    - 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);
                     }
                 }