Skip to content

[fix](schema-change) Use actual schema change alter version in cloud capture#62506

Open
Hastyshell wants to merge 2 commits intoapache:masterfrom
Hastyshell:fix-cloud-sc-alter-version-capture-20260415
Open

[fix](schema-change) Use actual schema change alter version in cloud capture#62506
Hastyshell wants to merge 2 commits intoapache:masterfrom
Hastyshell:fix-cloud-sc-alter-version-capture-20260415

Conversation

@Hastyshell
Copy link
Copy Markdown
Collaborator

@Hastyshell Hastyshell commented Apr 15, 2026

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Cloud schema change in BE decides whether to capture historical rowsets using the original FE task alter version, but later executes and commits using the alter version registered in meta service. When the FE task is created at version 1 and the registered schema change job uses a later alter version, BE can skip capturing historical rowsets and then commit an empty schema change output.

This change uses the registered schema change alter version consistently when deciding whether historical rowsets need to be captured.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • 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
        - Small conditional fix in cloud schema change capture logic only; no test was run in this session.
  • Behavior changed:

    • No.
    • Yes.
      - Cloud schema change now decides whether to capture historical rowsets using the alter version registered in meta service, avoiding empty schema change output in the version-1 to later-version race.
  • 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: None

Related PR: None

Problem Summary: Cloud schema change may register an alter_version greater than the FE task's original visible version. When the task is created at version 1 but starts after new versions arrive, BE can skip capturing historical rowsets and later commit an empty schema change output.

### Release note

None

### Check List (For Author)

- Test: No need to test (small condition fix; not run in this session)
- Behavior changed: Yes (cloud schema change now captures historical rowsets using the registered alter_version to avoid empty output on schema change races)
- Does this need documentation: No
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 15, 2026

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?

@Hastyshell Hastyshell changed the title [fix](be) Use actual schema change alter version in cloud capture [fix](schema-change) Use actual schema change alter version in cloud capture Apr 15, 2026
gavinchou
gavinchou previously approved these changes Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Add a cloud regression test for the inverted index schema change race where FE creates the alter task at version 1 but BE registers a later alter_version after new data is published. Also document why cloud schema change must use the meta-service alter_version when deciding whether to capture historical rowsets.

### Release note

None

### Check List (For Author)

- Test: No need to test (regression case added but not run in this session)
- Behavior changed: No
- Does this need documentation: No
@Hastyshell
Copy link
Copy Markdown
Collaborator Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Apr 15, 2026
@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.53% (27359/37210)
Line Coverage 57.24% (295654/516511)
Region Coverage 54.51% (246492/452223)
Branch Coverage 56.08% (106666/190204)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants