apache / apache/paimon

[Feature] Improve the tryCommitOnce behavior in FileStoreCommitImpl

Open
#3,351 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Motivation

When using dedicated compactions in production, we've found the write only job and compact job will failover every 2 or 3 days even if the remote filesystem support atomic rename operation.

The main cause is the FileAlreadyExistsException:
![image](https://github.com/apache/paimon/assets/3021821/fef85c30-17cc-41c4-b409-ba534f2841ca)

Checking with recent Hadoop API Rename implementation, we found the rename api will return FileAlreadyExistsException for rename api instead of false by default.
https://github.com/apache/hadoop/blob/branch-3.3.6/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java
![image](https://github.com/apache/paimon/assets/3021821/57372e8f-a1ec-4979-ab29-00d9780adf92)

IMHO, this can be improved by catch certain exceptions in tryCommitOnce and return false to upper caller.

### Solution

_No response_

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating FileStoreCommitImpl.tryCommitOnce and the upper caller that handles its result. Compare the remote filesystem rename behavior described in the issue with the current exception path; done means the relevant FileAlreadyExistsException case is handled so the caller receives false instead of the job failing over.

Written by the indexing model from the issue text.

Assessment

Tech stack
hadoop, java
Domain
data-engineering, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.