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 30e29abe60 do not emit lag once tabledatamanager shutdown (#11534)
30e29abe60 is described below

commit 30e29abe601bebbd5d4c513acaa73819eac59fe4
Author: Johan Adami <[email protected]>
AuthorDate: Tue Sep 12 17:05:53 2023 -0400

    do not emit lag once tabledatamanager shutdown (#11534)
---
 .../pinot/core/data/manager/realtime/IngestionDelayTracker.java      | 3 ++-
 .../pinot/core/data/manager/realtime/RealtimeTableDataManager.java   | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java
index 57ca21def1..b2eeae7bb6 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java
@@ -210,8 +210,9 @@ public class IngestionDelayTracker {
    */
   public void updateIngestionDelay(long ingestionTimeMs, long 
firstStreamIngestionTimeMs, int partitionGroupId) {
     // Store new measure and wipe old one for this partition
-    if (!_isServerReadyToServeQueries.get()) {
+    if (!_isServerReadyToServeQueries.get() || 
_realTimeTableDataManager.isShutDown()) {
       // Do not update the ingestion delay metrics during server startup period
+      // or once the table data manager has been shutdown.
       return;
     }
     if ((ingestionTimeMs < 0) && (firstStreamIngestionTimeMs < 0)) {
diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java
index ebd5aee4f2..b963ac8bc7 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java
@@ -247,6 +247,9 @@ public class RealtimeTableDataManager extends 
BaseTableDataManager {
 
   @Override
   protected void doShutdown() {
+    // Make sure we do metric cleanup when we shut down the table.
+    // Do this first, so we do not show ingestion lag during shutdown.
+    _ingestionDelayTracker.shutdown();
     if (_tableUpsertMetadataManager != null) {
       // Stop the upsert metadata manager first to prevent removing metadata 
when destroying segments
       _tableUpsertMetadataManager.stop();
@@ -262,8 +265,6 @@ public class RealtimeTableDataManager extends 
BaseTableDataManager {
     if (_leaseExtender != null) {
       _leaseExtender.shutDown();
     }
-    // Make sure we do metric cleanup when we shut down the table.
-    _ingestionDelayTracker.shutdown();
   }
 
   /*


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to