You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2023/07/25 23:50:01 UTC

[pinot] branch master updated: Add stat to track number of segments that have valid doc id snapshots (#11110)

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

jackie 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 9e079b1da9 Add stat to track number of segments that have valid doc id snapshots (#11110)
9e079b1da9 is described below

commit 9e079b1da94e9b3b980a3a4df4807e8091bc681f
Author: Kartik Khare <kh...@gmail.com>
AuthorDate: Wed Jul 26 05:19:56 2023 +0530

    Add stat to track number of segments that have valid doc id snapshots (#11110)
---
 .../src/main/java/org/apache/pinot/common/metrics/ServerGauge.java    | 4 +++-
 .../segment/local/upsert/BasePartitionUpsertMetadataManager.java      | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
index 210d95fc2f..cf8a2a304d 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
@@ -48,7 +48,9 @@ public enum ServerGauge implements AbstractMetrics.Gauge {
   JVM_HEAP_USED_BYTES("bytes", true),
   // Ingestion delay metrics
   REALTIME_INGESTION_DELAY_MS("milliseconds", false),
-  END_TO_END_REALTIME_INGESTION_DELAY_MS("milliseconds", false);
+  END_TO_END_REALTIME_INGESTION_DELAY_MS("milliseconds", false),
+  // Needed to track if valid doc id snapshots are present for faster restarts
+  UPSERT_VALID_DOC_ID_SNAPSHOT_COUNT("upsertValidDocIdSnapshotCount", false);
 
   private final String _gaugeName;
   private final String _unit;
diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
index 6dc9d2bb7f..2b7b36e9ef 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
@@ -599,6 +599,8 @@ public abstract class BasePartitionUpsertMetadataManager implements PartitionUps
       }
     }
 
+    _serverMetrics.setValueOfPartitionGauge(_tableNameWithType, _partitionId,
+        ServerGauge.UPSERT_VALID_DOC_ID_SNAPSHOT_COUNT, numImmutableSegments);
     _logger.info("Finished taking snapshot for {} immutable segments (out of {} total segments) in {}ms",
         numImmutableSegments, numTrackedSegments, System.currentTimeMillis() - startTimeMs);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org