shangxinli commented on code in PR #20028:
URL: https://github.com/apache/hudi/pull/20028#discussion_r4371338571
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java:
##########
@@ -346,14 +409,14 @@ public synchronized boolean tryLock() {
logInfoLockState(FAILED_TO_ACQUIRE, "Failed to get the latest lock
status");
hoodieLockMetrics.ifPresent(HoodieLockMetrics::updateLockStateUnknownMetric);
// We were not able to determine whether a lock was present.
- return false;
+ return AcquireAttemptResult.NOT_ACQUIRED;
}
if (latestLock.getLeft() == LockGetResult.SUCCESS &&
isLockStillValid(latestLock.getRight().get())) {
Review Comment:
This lock-already-held check doesn't distinguish a lock this same caller
just wrote on a prior TRANSIENT_ERROR retry from one held by a different owner,
unlike unlock() which got a self-ownership check, so a retry after an attempt
that actually landed reports the lock as held by someone else until it lapses.
--
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]