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

tkhurana pushed a commit to branch PHOENIX-7562-feature-new
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/PHOENIX-7562-feature-new by 
this push:
     new 2a8d3fe6ca PHOENIX-7874 Addendum add the replicationsynctime metric 
back
2a8d3fe6ca is described below

commit 2a8d3fe6cace94da5a975f331c258bb1b4aa4cc0
Author: tkhurana <[email protected]>
AuthorDate: Thu Aug 20 09:38:41 2026 -0700

    PHOENIX-7874 Addendum add the replicationsynctime metric back
---
 .../org/apache/phoenix/hbase/index/IndexRegionObserver.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
 
b/phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
index eca912f5fc..6490897e38 100644
--- 
a/phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
+++ 
b/phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
@@ -3520,6 +3520,9 @@ public class IndexRegionObserver implements 
RegionCoprocessor, RegionObserver {
     if (context.getOriginalMutations().isEmpty()) {
       return;
     }
+    // replicationSyncTime SLI: full per-batch replication cost (flatten + 
append + sync), not just
+    // the barrier that ReplicationLogGroup already meters. Recorded on the 
work path only.
+    long start = EnvironmentEdgeManager.currentTimeMillis();
     // Read the batch's now-final cells directly from miniBatchOp in POST. By 
this point HBase has
     // finalized timestamps and merged every coprocessor-added cell (local 
index, on-dup, TTL) into
     // the data mutation's family map (checkAndMergeCPMutations). Local-index 
(L#) cells are merged
@@ -3552,8 +3555,13 @@ public class IndexRegionObserver implements 
RegionCoprocessor, RegionObserver {
       return;
     }
     Map<String, byte[]> replicationAttributes = 
buildReplicationAttributes(context);
-    logGroup.append(dataTableName, -1, flattened, replicationAttributes);
-    logGroup.sync();
+    try {
+      logGroup.append(dataTableName, -1, flattened, replicationAttributes);
+      logGroup.sync();
+    } finally {
+      metricSource.updateReplicationSyncTime(dataTableName,
+        EnvironmentEdgeManager.currentTimeMillis() - start);
+    }
   }
 
   /**

Reply via email to