apache / apache/doris

[Bug] FE backup staging directories may not be cleaned up

Open
#65,632 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.

### Version

master

### What's Wrong?

FE writes backup metadata and job information to local staging directories under `tmp_dir`.

These directories are not cleaned up after they are no longer needed. For example, they may remain after a remote backup finishes or after a local snapshot expires or is evicted.

In addition, journal replay may create staging files on other FE nodes. Therefore, stale backup staging directories may accumulate independently on each FE and continuously consume disk space.

### What You Expected?

FE should automatically remove backup staging directories when they are no longer needed:

- Remove remote backup staging directories after the backup finishes or is cancelled.
- Keep local snapshot directories while the snapshot is valid, and remove them after expiration or eviction.
- Periodically remove orphan staging directories left by journal replay, FE restart, or interrupted cleanup.

### How to Reproduce?

_No response_

### Anything Else?

_No response_

### Are you willing to submit PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Research direction

Start by tracing FE backup metadata and job staging directories under tmp_dir through remote backup completion or cancellation and local snapshot expiration or eviction. Then inspect how journal replay, FE restart, and interrupted cleanup can leave orphan directories; done means valid local snapshots remain while remote and orphan staging directories are removed without affecting active work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.