Skip to content

[fix](regression) Support forced replica golden in show create case#65543

Merged
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/fix-show-create-table-replica-golden
Jul 15, 2026
Merged

[fix](regression) Support forced replica golden in show create case#65543
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/fix-show-create-table-replica-golden

Conversation

@shuke987

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

test_show_create_table_and_views_nereids creates OLAP tables with replication_num=1 and compares the complete SHOW CREATE TABLE result with a static golden. In test environments configured with force_olap_table_replication_num=3, Doris correctly rewrites the effective allocation to three replicas, but the case still expects one replica and fails before reaching the remaining view, rollup, and CREATE LIKE checks.

This change reads the effective forced replica configuration and selects a complete replica-specific golden for the four table-level SHOW CREATE TABLE checks. Both the one-replica and three-replica variants retain the full DDL comparison; unsupported forced replica values fail explicitly instead of weakening the assertion.

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

    Validation:

    • The target single case passed with forced replica 3 while generating the selected golden.
    • The target single case passed with both replica variants present and normal golden comparison enabled.
    • The replica-1 blocks exactly preserve the original master golden.
  • Behavior changed:

    • No.
    • Yes.
  • 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: The SHOW CREATE TABLE case always expected one replica even when test environments force OLAP tables to three replicas. Select the full golden matching the effective force replica configuration while preserving the existing one-replica baseline.

### Release note

None

### Check List (For Author)

- Test: Regression test

    - test_show_create_table_and_views_nereids with force replica 3

- Behavior changed: No

- 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?

@shuke987

Copy link
Copy Markdown
Collaborator Author

run buildall

@shuke987

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review result: request changes.

I found one regression-test correctness issue: the new replica-specific SHOW CREATE TABLE goldens cover non-cloud replica 1/3 output, but the same suite still runs in cloud P0 where SHOW CREATE TABLE emits cloud-specific properties. No existing inline review thread covered this.

Checkpoint summary: the change is narrow and has no production concurrency, lifecycle, persistence, FE/BE protocol, data-write, observability, or performance impact. The tag-block iterator can safely skip the unused replica variant, and the non-cloud forced-replica paths look consistent with checked-in configs. Test coverage is incomplete because cloud P0 output is not covered by the new expected blocks. No additional user focus was provided. Static review only; I did not run builds/tests per the review prompt.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Corrected inline anchor for the request-changes finding.

The issue remains the same: cloud P0 still runs this suite, but cloud SHOW CREATE TABLE emits cloud-specific properties while the new replica-specific expected blocks are non-cloud-only.

@shuke987 shuke987 marked this pull request as ready for review July 15, 2026 12:44
@hello-stephen hello-stephen merged commit 35f9812 into apache:master Jul 15, 2026
37 checks passed
yiguolei pushed a commit that referenced this pull request Jul 16, 2026
…reate case (#65673)

### What problem does this PR solve?

Issue Number: None

Related PR: #65543

Problem Summary:

Backport the forced-replica-aware SHOW CREATE golden selection to
branch-4.1. The branch-4.1 P0 environment forces OLAP tables to three
replicas, while this case only had the one-replica golden. The master
result file could not be cherry-picked directly because branch-4.1 does
not emit `binlog.format`, so this backport preserves the complete
branch-4.1 baseline and adds matching replica-1/replica-3 result blocks.

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
- The target case passed with forced replica 3 while validating #65543.
- Verified all four replica-1 blocks preserve the branch-4.1 baseline,
and each replica-3 block differs only in `replication_allocation`.
        - `git diff --check` passed.
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants