Skip to content

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

Merged
yiguolei merged 2 commits into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-63306
May 22, 2026
Merged

branch-4.1: [fix](fe) add --drop_backends param to start_fe.sh (#63306)#63515
yiguolei merged 2 commits into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-63306

Conversation

@mymeiyi
Copy link
Copy Markdown
Contributor

@mymeiyi mymeiyi commented May 22, 2026

pick #63306

This PR adds a --drop_backends startup flag for Doris FE, wiring it through bin/start_fe.sh into FE argument parsing, and executing backend removal when the FE becomes master.
@mymeiyi mymeiyi requested a review from yiguolei as a code owner May 22, 2026 03:49
Copilot AI review requested due to automatic review settings May 22, 2026 03:49
@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 22, 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 that, when enabled, triggers Doris FE to remove all backends from cluster metadata at the moment the FE becomes MASTER. It’s wired end-to-end from bin/start_fe.sh through FE argument parsing into Env.transferToMaster() (and is also enabled during the cloud recovery path in the docker compose runtime init script).

Changes:

  • Add --drop_backends option parsing in bin/start_fe.sh and forward it to org.apache.doris.DorisFE.
  • Extend FE CLI parsing (DorisFE.parseArgs) to set a system property flag for drop_backends.
  • When transferring to MASTER (Env.transferToMaster), drop all backends (non-cloud via dropBackend, cloud via CloudSystemInfoService.updateCloudBackends).
  • Enable --drop_backends automatically in the cloud recovery startup path (docker/runtime/.../init_fe.sh).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
fe/fe-core/src/main/java/org/apache/doris/DorisFE.java Adds the --drop_backends CLI option and sets the corresponding system property.
fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java Introduces the DROP_BACKENDS_KEY constant.
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java Drops all backends during transferToMaster() when the flag is enabled.
docker/runtime/doris-compose/resource/init_fe.sh Appends --drop_backends to recovery startup args in cloud compose runtime.
bin/start_fe.sh Parses and forwards the new --drop_backends shell flag to FE.

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

Comment on lines +1787 to +1791
} catch (Exception e) {
LOG.warn("failed to drop backends", e);
}
System.clearProperty(FeConstants.DROP_BACKENDS_KEY);
LOG.info("finished dropping all backends");
@mymeiyi
Copy link
Copy Markdown
Contributor Author

mymeiyi commented May 22, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.60% (1/168) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit a501a6c into apache:branch-4.1 May 22, 2026
28 of 31 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