Skip to content

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

Draft
shuke987 wants to merge 1 commit into
apache:masterfrom
shuke987:codex/fix-show-create-table-replica-golden
Draft

[fix](regression) Support forced replica golden in show create case#65543
shuke987 wants to merge 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.

(23, 900, 1)"""

qt_show "SHOW CREATE TABLE ${dbName}.${tableName}"
quickRunTest("show_initial_replica_${effectiveReplicaNum}", "SHOW CREATE TABLE ${dbName}.${tableName}")

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.

This still leaves the cloud P0 run broken. cloud_p0/conf/regression-conf-custom.groovy runs group p0, and the framework adds p0 to this suite from the show_p0 directory, so the suite is selected there. In that environment cloud_unique_id makes Config.isCloudMode() true, and Env.addOlapTablePropertyInfo() emits file_cache_ttl_seconds instead of replication_allocation/min_load_replica_num for SHOW CREATE TABLE. The new show_*_replica_1/3 blocks only contain the non-cloud property list, so the first quickRunTest will compare cloud output against the non-cloud golden before reaching the later checks. Please add/select cloud-specific SHOW CREATE blocks, skip this suite in cloud mode, or normalize the properties being compared.

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