You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "linliu-code (via GitHub)" <gi...@apache.org> on 2026/04/12 03:42:09 UTC

[I] wrong metric from renewLock() function [hudi]

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: commits-unsubscribe@hudi.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] wrong metric from renewLock() function [hudi]

Posted by "deepakpanda93 (via GitHub)" <gi...@apache.org>.
deepakpanda93 closed issue #18493: wrong metric from renewLock() function
URL: https://github.com/apache/hudi/issues/18493


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] wrong metric from renewLock() function [hudi]

Posted by "deepakpanda93 (via GitHub)" <gi...@apache.org>.
deepakpanda93 commented on issue #18493:
URL: https://github.com/apache/hudi/issues/18493#issuecomment-5355658371

   Thanks for reporting this.
   
   This looks addressed by #18492 (*fix: Fix lock expiration metric*, merged 2026-07-26).
   
   Note this merged after 1.2.0, so it is on `master` and will ship in the next release rather than being available in 1.2.0.
   
   Closing on that basis - please reopen or comment if you still see the behaviour on a build containing that change.


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org