linliu-code opened a new issue, #18493:
URL: https://github.com/apache/hudi/issues/18493

   ### Bug Description
   
   **What happened:**
   StorageBasedLockProvider.renewLock()
   ```java
   long oldExpirationMs = getLock().getValidUntilMs();
   // ... renewal succeeds, lock updated to new expiration (lockExpirationMs) 
...
   hoodieLockMetrics.ifPresent(metrics -> 
metrics.updateLockExpirationDeadlineMetric(
       (int) (oldExpirationMs - getCurrentEpochMs())));
   // Value: ~30000 ms (remaining time on the PREVIOUS lease, not the new one)
   ``` 
   After every heartbeat renewal the metric drops from ~300s to ~30s, then 
jumps back to ~300s on the next tryLock. This produces a misleading sawtooth 
pattern on dashboards.
   
   Note: the log message on the next line intentionally uses oldExpirationMs to 
report the heartbeat margin — that's correct and useful. Only the metric is 
wrong.
   
   **What you expected:**
   Metrics to report the correct expiration time.
   
   **Steps to reproduce:**
   1.
   2.
   3.
   
   
   ### Environment
   
   **Hudi version:**
   **Query engine:** (Spark/Flink/Trino etc)
   **Relevant configs:**
   
   
   ### Logs and Stack Trace
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to