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 a5b515c308 OAK-11891 : added stats for documents that were skipped due 
to presence of empty split props (#2496)
a5b515c308 is described below

commit a5b515c3086c5ee4975e7bcb022060ac6243f727
Author: Rishabh Kumar <rishabhdaim1...@gmail.com>
AuthorDate: Wed Sep 10 12:40:17 2025 +0530

    OAK-11891 : added stats for documents that were skipped due to presence of 
empty split props (#2496)
---
 .../jackrabbit/oak/plugins/document/FullGCStatsCollector.java  |  5 +++++
 .../oak/plugins/document/FullGCStatsCollectorImpl.java         |  9 +++++++++
 .../oak/plugins/document/VersionGarbageCollector.java          |  2 ++
 .../oak/plugins/document/FullGCStatsCollectorImplTest.java     | 10 ++++++++++
 4 files changed, 26 insertions(+)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollector.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollector.java
index a5d4981140..e679bbce68 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollector.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollector.java
@@ -91,6 +91,11 @@ public interface FullGCStatsCollector {
      */
     void documentsUpdateSkipped(long numDocs);
 
+    /**
+     * Total No. of documents that were skipped because of empty Split Props
+     */
+    void documentSkippedDueToEmptySplitProp();
+
     /**
      * No. of times the FullGC has started
      */
diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java
index 6ed7ff8c9d..a4a219831d 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImpl.java
@@ -49,6 +49,7 @@ class FullGCStatsCollectorImpl implements 
FullGCStatsCollector {
     static final String DELETED_REVISION = "DELETED_REVISION";
     static final String UPDATED_DOC = "UPDATED_DOC";
     static final String SKIPPED_DOC = "SKIPPED_DOC";
+    static final String SKIPPED_DOC_EMPTY_SPLIT_PROP = 
"SKIPPED_DOC_EMPTY_SPLIT_PROP";
     static final String FULL_GC_ACTIVE_TIMER = "FULL_GC_ACTIVE_TIMER";
     static final String FULL_GC_TIMER = "FULL_GC_TIMER";
     static final String COLLECT_FULL_GC_TIMER = "COLLECT_FULL_GC_TIMER";
@@ -78,6 +79,7 @@ class FullGCStatsCollectorImpl implements 
FullGCStatsCollector {
     private final MeterStats deletedUnmergedBC;
     private final MeterStats updatedDoc;
     private final MeterStats skippedDoc;
+    private final MeterStats skippedDocEmptySplitProp;
 
     private final Map<GCPhase, MeterStats> candidateRevisions;
     private final Map<GCPhase, MeterStats> candidateInternalRevisions;
@@ -121,6 +123,7 @@ class FullGCStatsCollectorImpl implements 
FullGCStatsCollector {
         deletedUnmergedBC = meter(provider, DELETED_UNMERGED_BC);
         updatedDoc = meter(provider, UPDATED_DOC);
         skippedDoc = meter(provider, SKIPPED_DOC);
+        skippedDocEmptySplitProp = meter(provider, 
SKIPPED_DOC_EMPTY_SPLIT_PROP);
 
         candidateRevisions = new EnumMap<>(GCPhase.class);
         candidateInternalRevisions = new EnumMap<>(GCPhase.class);
@@ -192,6 +195,11 @@ class FullGCStatsCollectorImpl implements 
FullGCStatsCollector {
         skippedDoc.mark(numDocs);
     }
 
+    @Override
+    public void documentSkippedDueToEmptySplitProp() {
+        skippedDocEmptySplitProp.mark();
+    }
+
     @Override
     public void started() {
         counter.inc();
@@ -273,6 +281,7 @@ class FullGCStatsCollectorImpl implements 
FullGCStatsCollector {
                 ", deletedUnmergedBC=" + deletedUnmergedBC.getCount() +
                 ", updatedDoc=" + updatedDoc.getCount() +
                 ", skippedDoc=" + skippedDoc.getCount() +
+                ", skippedDocDueToEmptySplitProps=" + 
skippedDocEmptySplitProp.getCount() +
                 '}';
     }
 
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 f313268b49..f66851e8ae 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
@@ -1491,6 +1491,8 @@ public class VersionGarbageCollector {
                             AUDIT_LOG.info("<Skipping> empty props deletion in 
[{}] due to presence of deleted Split Properties [{}].",
                                     doc.getId(), 
SetUtils.intersection(splitProps, propsToBeDeleted));
                         }
+                        // added to stats that it is skipped to presence of 
empty split props
+                        fullGCStats.documentSkippedDueToEmptySplitProp();
                         phases.stop(GCPhase.FULL_GC_COLLECT_PROPS);
                         return;
                     }
diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImplTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImplTest.java
index c3eac11bdd..4d8e240640 100644
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImplTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/FullGCStatsCollectorImplTest.java
@@ -60,6 +60,7 @@ import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImp
 import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImpl.PROGRESS_SIZE;
 import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImpl.READ_DOC;
 import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImpl.SKIPPED_DOC;
+import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImpl.SKIPPED_DOC_EMPTY_SPLIT_PROP;
 import static 
org.apache.jackrabbit.oak.plugins.document.FullGCStatsCollectorImpl.UPDATED_DOC;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -97,6 +98,15 @@ public class FullGCStatsCollectorImplTest {
         assertEquals(count + 17, ((MeterStats) readField(stats, "skippedDoc", 
true)).getCount());
     }
 
+    @Test
+    public void getDocumentsSkippedDueToEmptySplitPropsCount() throws 
IllegalAccessException {
+        Meter m = getMeter(SKIPPED_DOC_EMPTY_SPLIT_PROP);
+        long count = m.getCount();
+        stats.documentSkippedDueToEmptySplitProp();
+        assertEquals(count + 1, m.getCount());
+        assertEquals(count + 1, ((MeterStats) readField(stats, 
"skippedDocEmptySplitProp", true)).getCount());
+    }
+
     @Test
     public void getOrphanNodesDeletedCount() throws IllegalAccessException {
         Meter m = getMeter(DELETED_ORPHAN_NODE);

Reply via email to