linliu-code opened a new pull request, #20129:
URL: https://github.com/apache/hudi/pull/20129

   ### Describe the issue this Pull Request addresses
   
   closes #20128
   
   Stacked on #20028; please review that first. Until it merges, this PR also 
shows its commits; the change here is the last commit.
   
   ### Summary and Changelog
   
   A lock-expire write that fails with an indeterminate storage error 
(UNKNOWN_ERROR, for example a dropped connection) was terminal, so unlock() 
gave up after one attempt and the lock dangled until its lease elapsed. It is 
now retried like a 5xx.
   
   - tryExpireCurrentLock returns a retriable ExpireLockResult.UNKNOWN_ERROR 
instead of FAILED, so unlock() retries it with the existing 1s/2s/4s budget, 
lock-identity guard and landed-write reconcile from #20028.
   - A reconcile read that throws is treated as "not landed", so unlock() fails 
with HoodieLockException instead of leaking a raw storage exception.
   - The release-failure log reports the number of retries actually run instead 
of the retry budget.
   
   Acquire and renew are unchanged: renew already retries UNKNOWN_ERROR on the 
next heartbeat, and retrying an indeterminate renew in the same cycle is unsafe 
without a renew-side reconcile.
   
   ### Impact
   
   Fewer dangling locks from transient connection-level failures on release, 
for every storage lock client. A non-transient rejection that also maps to 
UNKNOWN_ERROR now fails after the retry budget (about 7s, 4 writes) instead of 
immediately. No config or public API change. The GCS client never returns 
UNKNOWN_ERROR (its connection errors are rethrown), so GCS behavior is 
unchanged. lock.state.unknown now counts once per expire attempt, so up to 4 
times for one failed release.
   
   ### Risk Level
   
   low. The retry keeps the original precondition, so it cannot overwrite 
another writer, and a landed first write is reconciled. New tests cover a retry 
that succeeds, a landed write, retry exhaustion, a real steal, and a reconcile 
read that throws; they fail when UNKNOWN_ERROR is removed from the retriable 
set.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
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