fengjian428 commented on code in PR #7440:
URL: https://github.com/apache/hudi/pull/7440#discussion_r1061587571
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/FileSystemBasedLockProvider.java:
##########
@@ -139,7 +152,32 @@ private boolean checkIfExpired() {
private void acquireLock() {
try {
- fs.create(this.lockFile, false).close();
+ if (!fs.exists(this.lockFile)) {
+ FSDataOutputStream fos = fs.create(this.lockFile, false);
+ initLockInfo();
+ fos.writeBytes(lockInfo.toString());
Review Comment:
sorry, I think adding instant time into file content cannot guarantee just
one process obtain the lock either. the other process still can overwrite the
file content after the first process already validated the file content.
file-based lock only works for DFS with atomic create/delete operation
--
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]