apache / apache/hudi

Multiple tasks get the lock at the same time when use occ

Open
#16,358 1 comment 0 reactions 0 assignees View on GitHub
area:concurrency from-jira priority:high type:bug
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

config:
* occ open
* use FileSystemBasedLock
* mdt is open in write defualt

there has three job, jobA, jobB, jobC, these three jobs are running at the same time.

jobA get lock success, jobB has been trying to get lock, jobC also try to get lock.

jobB failed because can not get lock, but it delete lock file when close write client, now, jobC will get lock, it cause concurrent problem.

In our case, jobC will rollback jobA mdt commit which has been succeed commited. So, the data table timeline has the repleaseCommit instance, but mdt without this update, it cause partition path be deleted and can not reserve the latest file split in our case

 

## JIRA info

- Link: https://issues.apache.org/jira/browse/HUDI-7259
- Type: Bug

---

## Comments

14/Mar/25 17:07;yihua;I don't think the current implementation of `FileSystemBasedLock` guarantees only one writer gets the lock because atomic creation is not enough.  The conditional writes need to be supported by the file system and used in the lock provider.  See new RFC-91 for the new design: https://github.com/apache/hudi/pull/12927;;;

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the FileSystemBasedLock implementation and the linked RFC-91 design in PR 12927. Reproduce the jobA/jobB/jobC sequence described in the issue, then compare the behavior with the proposed design. Done means concurrent writers cannot remove or bypass the lock and the reported rollback scenario is prevented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.