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

daim 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 298dec13e2 OAK-11401 : increased audit log level for VGC (#2024)
298dec13e2 is described below

commit 298dec13e213826f0594f9543b9fb54e95c7ccd5
Author: Rishabh Kumar <rishabhdaim1...@gmail.com>
AuthorDate: Fri Jan 24 20:01:31 2025 +0530

    OAK-11401 : increased audit log level for VGC (#2024)
    
    Co-authored-by: Rishabh Kumar <d...@adobe.com>
---
 .../plugins/document/VersionGarbageCollector.java  | 56 ++++++++++------------
 1 file changed, 25 insertions(+), 31 deletions(-)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
index 4182ea32d5..ad89f442ab 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
@@ -1269,8 +1269,8 @@ public class VersionGarbageCollector {
 
                 // update the deleted properties count Map to calculate the 
total no. of deleted properties
                 int totalDeletedSystemPropsCount = 
deletedInternalPropsCountMap.merge(doc.getId(), deletedSystemPropsCount, 
Integer::sum);
-                if (AUDIT_LOG.isDebugEnabled() && totalDeletedSystemPropsCount 
> 0) {
-                    AUDIT_LOG.debug("<Collected> [{}] internal prop revs in 
[{}] mode [{}]", totalDeletedSystemPropsCount, doc.getId(), fullGcMode);
+                if (AUDIT_LOG.isInfoEnabled() && totalDeletedSystemPropsCount 
> 0) {
+                    AUDIT_LOG.info("<Collected> [{}] internal prop revs in 
[{}] mode [{}]", totalDeletedSystemPropsCount, doc.getId(), fullGcMode);
                 }
             }
         }
@@ -1348,9 +1348,7 @@ public class VersionGarbageCollector {
             orphanOrDeletedRemovalPathMap.put(doc.getId(), doc.getPath());
             
fullGCStats.candidateDocuments(GCPhase.FULL_GC_COLLECT_ORPHAN_NODES, 1);
 
-            if (AUDIT_LOG.isDebugEnabled()) {
-                AUDIT_LOG.debug("<Collected> [{}] orphaned node", doc.getId());
-            }
+            AUDIT_LOG.info("<Collected> [{}] orphaned node in mode [{}]", 
doc.getId(), fullGcMode);
 
             phases.stop(GCPhase.FULL_GC_COLLECT_ORPHAN_NODES);
             return true;
@@ -1388,8 +1386,8 @@ public class VersionGarbageCollector {
                 deletedPropsCountMap.put(doc.getId(), deletedPropsCount);
                 fullGCStats.candidateProperties(GCPhase.FULL_GC_COLLECT_PROPS, 
deletedPropsCount);
 
-                if (AUDIT_LOG.isDebugEnabled() && deletedPropsCount > 0) {
-                    AUDIT_LOG.debug("<Collected> [{}] deleted props in [{}]", 
deletedPropsCount, doc.getId());
+                if (AUDIT_LOG.isInfoEnabled() && deletedPropsCount > 0) {
+                    AUDIT_LOG.info("<Collected> [{}] deleted props in [{}]. 
Property Names [{}]", deletedPropsCount, doc.getId(), 
updateOp.getChanges().keySet());
                 }
                 phases.stop(GCPhase.FULL_GC_COLLECT_PROPS);
             }
@@ -1427,8 +1425,8 @@ public class VersionGarbageCollector {
             olderUnmergedBranchCommits.forEach(bcRevision -> 
removeUnmergedBCRevision(bcRevision, doc, updateOp));
             deletedUnmergedBCSet.addAll(olderUnmergedBranchCommits);
 
-            if (AUDIT_LOG.isDebugEnabled()) {
-                AUDIT_LOG.debug("<Collected> [{}] unmerged branch commits in 
[{}]", olderUnmergedBranchCommits.size(), doc.getId());
+            if (AUDIT_LOG.isInfoEnabled()) {
+                AUDIT_LOG.info("<Collected> [{}] unmerged branch commits in 
[{}]", olderUnmergedBranchCommits.size(), doc.getId());
             }
 
             // now for any of the handled system properties (the normal 
properties would
@@ -1459,8 +1457,8 @@ public class VersionGarbageCollector {
                 int totalDeletedSystemPropsCount = 
deletedInternalPropsCountMap.merge(doc.getId(), deletedSystemPropsCount, 
Integer::sum);
                 
fullGCStats.candidateInternalRevisions(GCPhase.FULL_GC_COLLECT_UNMERGED_BC, 
totalDeletedSystemPropsCount);
 
-                if (AUDIT_LOG.isDebugEnabled() && totalDeletedSystemPropsCount 
> 0) {
-                    AUDIT_LOG.debug("<Collected> [{}] internal prop revs in 
[{}] mode [{}]", totalDeletedSystemPropsCount, doc.getId(), fullGcMode);
+                if (AUDIT_LOG.isInfoEnabled() && totalDeletedSystemPropsCount 
> 0) {
+                    AUDIT_LOG.info("<Collected> [{}] internal prop revs in 
[{}] mode [{}]", totalDeletedSystemPropsCount, doc.getId(), fullGcMode);
                 }
             }
             phases.stop(GCPhase.FULL_GC_COLLECT_UNMERGED_BC);
@@ -1619,8 +1617,8 @@ public class VersionGarbageCollector {
             
fullGCStats.candidateRevisions(GCPhase.FULL_GC_COLLECT_UNMERGED_BC, 
revEntriesCount);
             
fullGCStats.candidateInternalRevisions(GCPhase.FULL_GC_COLLECT_UNMERGED_BC, 
internalRevEntriesCount);
 
-            if (AUDIT_LOG.isDebugEnabled() && (revEntriesCount > 0 || 
internalRevEntriesCount > 0)) {
-                AUDIT_LOG.debug("<Collected> [{}] prop revs, [{}] internal 
prop revs in [{}] mode [{}]", revEntriesCount, internalRevEntriesCount, 
doc.getId(), fullGcMode);
+            if (AUDIT_LOG.isInfoEnabled() && (revEntriesCount > 0 || 
internalRevEntriesCount > 0)) {
+                AUDIT_LOG.info("<Collected> [{}] prop revs, [{}] internal prop 
revs in [{}] mode [{}]", revEntriesCount, internalRevEntriesCount, doc.getId(), 
fullGcMode);
             }
 
         }
@@ -1640,8 +1638,8 @@ public class VersionGarbageCollector {
                 if (intRevsDiff > 0) {
                     deletedInternalPropRevsCountMap.merge(doc.getId(), 
intRevsDiff, Integer::sum);
                 }
-                if (AUDIT_LOG.isDebugEnabled() && (revsDiff > 0 || intRevsDiff 
> 0)) {
-                    AUDIT_LOG.debug("<Collected> [{}] prop revs, [{}] internal 
prop revs in [{}] mode [{}]", revsDiff, intRevsDiff, doc.getId(), fullGcMode);
+                if (AUDIT_LOG.isInfoEnabled() && (revsDiff > 0 || intRevsDiff 
> 0)) {
+                    AUDIT_LOG.info("<Collected> [{}] prop revs, [{}] internal 
prop revs in [{}] mode [{}]", revsDiff, intRevsDiff, doc.getId(), fullGcMode);
                 }
                 
fullGCStats.candidateRevisions(GCPhase.FULL_GC_COLLECT_OLD_REVS, revsDiff);
                 
fullGCStats.candidateInternalRevisions(GCPhase.FULL_GC_COLLECT_OLD_REVS, 
intRevsDiff);
@@ -1690,8 +1688,8 @@ public class VersionGarbageCollector {
                 deletedInternalPropRevsCountMap.merge(doc.getId(), 
deletedInternalRevsCount, Integer::sum);
             }
 
-            if (AUDIT_LOG.isDebugEnabled() && deletedTotalRevsCount > 0) {
-                AUDIT_LOG.debug("<Collected> [{}] prop revs, [{}] internal 
prop revs in [{}] mode [{}]", deletedUserRevsCount, deletedInternalRevsCount, 
doc.getId(), fullGcMode);
+            if (AUDIT_LOG.isInfoEnabled() && deletedTotalRevsCount > 0) {
+                AUDIT_LOG.info("<Collected> [{}] prop revs, [{}] internal prop 
revs in [{}] mode [{}]", deletedUserRevsCount, deletedInternalRevsCount, 
doc.getId(), fullGcMode);
             }
             fullGCStats.candidateRevisions(GCPhase.FULL_GC_COLLECT_OLD_REVS, 
deletedUserRevsCount);
             
fullGCStats.candidateInternalRevisions(GCPhase.FULL_GC_COLLECT_OLD_REVS, 
deletedInternalRevsCount);
@@ -1924,18 +1922,18 @@ public class VersionGarbageCollector {
         public void removeGarbage(final VersionGCStats stats) {
 
             if (updateOpList.isEmpty() && orphanOrDeletedRemovalMap.isEmpty()) 
{
-                if (log.isDebugEnabled() || isFullGCDryRun) {
-                    log.debug("Skipping removal of Full garbage, cause no 
garbage detected");
+                if (log.isInfoEnabled() || isFullGCDryRun) {
+                    log.info("Skipping removal of Full garbage, cause no 
garbage detected");
                 }
                 return;
             }
 
             monitor.info("Proceeding to update [{}] documents", 
updateOpList.size());
 
-            if (AUDIT_LOG.isDebugEnabled() || isFullGCDryRun) {
+            if (AUDIT_LOG.isInfoEnabled() || isFullGCDryRun) {
                 String updateIds = 
updateOpList.stream().map(UpdateOp::getId).collect(joining(", "));
                 String orphanIds = join(", ", 
orphanOrDeletedRemovalMap.keySet());
-                log.debug("Performing batch update of ids [{}] and removal of 
orphan ids [{}]", updateIds, orphanIds);
+                AUDIT_LOG.info("Performing batch update of ids [{}] and 
removal of orphan ids [{}]", updateIds, orphanIds);
             }
 
             if (cancel.get()) {
@@ -1969,9 +1967,7 @@ public class VersionGarbageCollector {
                         if (!verifyViaTraversedState(traversedState, 
traversedParent, newDoc)) {
                             // verification failure
                             // let's skip this document
-                            if (log.isDebugEnabled()) {
-                                log.debug("removeGarbage.verify : 
verifyViaTraversedState failed for [{}]", newDoc.getId());
-                            }
+                            log.warn("removeGarbage.verify : 
verifyViaTraversedState failed for [{}]", newDoc.getId());
                             it.remove();
                             stats.skippedFullGCDocsCount++;
                         }
@@ -1993,9 +1989,7 @@ public class VersionGarbageCollector {
                         if (!verifyDeletion(traversedState)) {
                             // verification failure
                             // let's skip this document
-                            if (log.isDebugEnabled()) {
-                                log.debug("removeGarbage.verify : 
verifyDeletion failed for [{}]", e.getKey());
-                            }
+                            log.warn("removeGarbage.verify : verifyDeletion 
failed for [{}]", e.getKey());
                             it.remove();
                             stats.skippedFullGCDocsCount++;
                         }
@@ -2016,8 +2010,8 @@ public class VersionGarbageCollector {
                         stats.deletedDocGCCount += removedSize;
                         stats.deletedOrphanNodesCount += removedSize;
 
-                        if (AUDIT_LOG.isDebugEnabled()) {
-                            AUDIT_LOG.debug("<delete> [{}] documents (from 
intended {})", removedSize, orphanOrDeletedRemovalMap.size());
+                        if (AUDIT_LOG.isInfoEnabled()) {
+                            AUDIT_LOG.info("<delete> [{}] documents (from 
intended {})", removedSize, orphanOrDeletedRemovalMap.size());
                         }
 
                         // save stats
@@ -2044,8 +2038,8 @@ public class VersionGarbageCollector {
                         stats.deletedInternalPropRevsCount += 
deletedInternalRevEntriesCount;
                         stats.deletedUnmergedBCCount += 
deletedUnmergedBCSet.size();
 
-                        if (log.isDebugEnabled()) {
-                            log.debug("Updated [{}] docs, deleted [{}] props, 
deleted [{}] unmergedBCs, deleted [{}] internal Props, deleted [{}] prop revs, 
deleted [{}] internal prop revs",
+                        if (log.isInfoEnabled()) {
+                            log.info("Updated [{}] docs, deleted [{}] props, 
deleted [{}] unmergedBCs, deleted [{}] internal Props, deleted [{}] prop revs, 
deleted [{}] internal prop revs",
                                     updatedDocs, deletedProps, 
deletedUnmergedBCSet.size(), deletedInternalProps, deletedRevEntriesCount, 
deletedInternalRevEntriesCount);
                         }
 

Reply via email to