Skip to content

[fix](docker) Propagate BE registration failures - #66927

Open
Al-assad wants to merge 1 commit into
apache:masterfrom
Al-assad:fix-be-registration-failure
Open

[fix](docker) Propagate BE registration failures#66927
Al-assad wants to merge 1 commit into
apache:masterfrom
Al-assad:fix-be-registration-failure

Conversation

@Al-assad

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary:

The Kubernetes BE entrypoint scripts initialized REGISTERED to the literal string false and later evaluated it with [[ $REGISTERED ]]. In Bash, every non-empty string is true, so an FE registration failure could be treated as success and the script would continue to start BE without registering it with FE.

This PR removes the unused string flag and uses the exit status from add_self / first_deploy_start directly. Each configured FE address is tried in order. If all registration attempts fail, the entrypoint exits before start_be.sh, allowing Kubernetes to restart the container and retry after FE becomes available.

Supersedes #66922, which GitHub automatically closed after its cross-fork head branch was renamed.

Release note

Fix Kubernetes BE containers to restart instead of starting unregistered when FE registration fails.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • bash -n docker/runtime/be/resource/be_entrypoint.sh
      • bash -n docker/runtime/be/resource/be_disaggregated_entrypoint.sh
      • build-support/shell-check.sh
      • Mocked registration success, first-address failover, and all-addresses-failed return paths for both scripts
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes. BE containers now exit when all FE registration attempts fail instead of starting unregistered.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: The Kubernetes BE entrypoint scripts stored the literal string false in REGISTERED and tested it as a shell condition. Because any non-empty string is true in Bash, a failed FE registration was treated as successful and the BE process could start without being registered. Use the registration function exit status directly, try each configured FE address, and terminate the container before starting BE when every registration attempt fails.

### Release note

Fix Kubernetes BE containers to restart instead of starting unregistered when FE registration fails.

### Check List (For Author)

- Test: Manual test
    - bash -n for both BE entrypoint scripts
    - Mocked success, failover, and all-addresses-failed return paths
    - build-support/shell-check.sh
- Behavior changed: Yes. BE containers now exit when all FE registration attempts fail.
- Does this need documentation: No
@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?

@Al-assad

Copy link
Copy Markdown
Member Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-20T03:35:00Z.
Workflow run: https://github.com/apache/doris/actions/runs/32221761682

Please trigger /review again after that time.

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.

2 participants