Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] OrphanFilesClean has a chance to delete normal files #3074

Closed
2 tasks done
wxplovecc opened this issue Mar 21, 2024 · 2 comments · Fixed by #3075
Closed
2 tasks done

[Bug] OrphanFilesClean has a chance to delete normal files #3074

wxplovecc opened this issue Mar 21, 2024 · 2 comments · Fixed by #3075
Labels
bug Something isn't working

Comments

@wxplovecc
Copy link
Contributor

wxplovecc commented Mar 21, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master

Compute Engine

flink

Minimal reproduce step

1、Start a streaming write job with ckp (5 second)
2、Sleep some time between
Set<String> usedFiles = getUsedFiles(); Thread.sleep(20000) Map<String, Path> candidates = getCandidateDeletingFiles();
3、Do clean orphanFiles
4、
企业微信截图_171102857042

What doesn't meet your expectations?

Should not delete normal file

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@yuzelin
Copy link
Contributor

yuzelin commented Mar 22, 2024

In previous design, getCandidateDeletingFiles is called after getUsedFiles, so it may read newly committed files, and the newly committed files are not in usedFiles, so these files will be deleted incorrectly, am I right?
But we use oldEnough to protect the new files, so I don't know why the files are deleted. Can you explain more details?

@yuzelin
Copy link
Contributor

yuzelin commented Mar 27, 2024

Anyway, put getUsedFiles() after getCandidateDeletingFiles() is correct. I think your change is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants