Skip to content

branch-4.0: [fix](fe) add --drop_backends param to start_fe.sh (#63306)#63795

Merged
morningman merged 1 commit into
apache:branch-4.0from
mymeiyi:branch-4.0-pick-63306
May 29, 2026
Merged

branch-4.0: [fix](fe) add --drop_backends param to start_fe.sh (#63306)#63795
morningman merged 1 commit into
apache:branch-4.0from
mymeiyi:branch-4.0-pick-63306

Conversation

@mymeiyi
Copy link
Copy Markdown
Contributor

@mymeiyi mymeiyi commented May 28, 2026

pick #63306

Copilot AI review requested due to automatic review settings May 28, 2026 06:30
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@mymeiyi
Copy link
Copy Markdown
Contributor Author

mymeiyi commented May 28, 2026

run buildall

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backports a new FE startup flag --drop_backends to branch-4.0, wiring it from bin/start_fe.sh into FE argument parsing and executing backend removal when the FE transitions to MASTER (including a docker-compose cloud recovery path).

Changes:

  • Add --drop_backends parsing in bin/start_fe.sh and propagate it into the FE Java process args.
  • Add FE CLI option/system property plumbing (FeConstants + DorisFE.parseArgs) for drop_backends.
  • On master transfer (Env.transferToMaster()), drop all backends (normal mode) or delete cloud backends (cloud mode); docker cloud recovery script now enables this flag during metadata failure recovery.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
fe/fe-core/src/main/java/org/apache/doris/DorisFE.java Adds a new CLI option and sets a system property when --drop_backends is present.
fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java Defines the drop_backends system property key.
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java Executes backend deletion when the FE becomes MASTER and the flag is set.
docker/runtime/doris-compose/resource/init_fe.sh Enables --drop_backends during cloud snapshot restore recovery startup.
bin/start_fe.sh Adds --drop_backends getopt parsing and passes it to the FE JVM command line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1778 to +1782
if (Config.isNotCloudMode()) {
for (Backend be : bes) {
systemInfoService.dropBackend(be.getHost(), be.getHeartbeatPort());
}
} else {
Comment on lines +1785 to +1789
} catch (Exception e) {
LOG.warn("failed to drop backends", e);
}
System.clearProperty(FeConstants.DROP_BACKENDS_KEY);
LOG.info("finished dropping all backends");
@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 15.00% (3/20) 🎉
Increment coverage report
Complete coverage report

@morningman morningman merged commit 916286f into apache:branch-4.0 May 29, 2026
29 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants