Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Fix unstable test alter_pk (#8917) #8996

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #8917

What problem does this PR solve?

Issue Number: close #8916

Problem Summary:

After executing alter table test.t add primary key new_pk(a,b,c), the table schema is not synced to the latest one when reading from tiflash. Because casting from nullable to not null can be automatically done in the DeltaMergeStore level. So sometime the integration test is not stable. Introduced by #7630

[2024-04-09T07:08:15.819Z] fullstack-test2/ddl/alter_pk.test: Running
[2024-04-09T07:08:24.856Z]   File: fullstack-test2/ddl/alter_pk.test
[2024-04-09T07:08:24.856Z]   Error line: 35
[2024-04-09T07:08:24.856Z]   Error: DBGInvoke query_mapped('desc \$d.\$t', test, t)
[2024-04-09T07:08:24.856Z]   Result:
[2024-04-09T07:08:24.856Z]     ┌─name────────┬─type────────────┬─default_type─┬─default_expression─┐
[2024-04-09T07:08:24.856Z]     │ a           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ b           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ c           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ d           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ e           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ f           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ _tidb_rowid │ Int64           │              │                    │
[2024-04-09T07:08:24.856Z]     └─────────────┴─────────────────┴──────────────┴────────────────────┘
[2024-04-09T07:08:24.856Z]   Expected:
[2024-04-09T07:08:24.856Z]     ┌─name────────┬─type────────────┬─default_type─┬─default_expression─┐
[2024-04-09T07:08:24.856Z]     │ a           │ Int32           │              │                    │
[2024-04-09T07:08:24.856Z]     │ b           │ Int32           │              │                    │
[2024-04-09T07:08:24.856Z]     │ c           │ Int32           │              │                    │
[2024-04-09T07:08:24.856Z]     │ d           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ e           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ f           │ Nullable(Int32) │              │                    │
[2024-04-09T07:08:24.856Z]     │ _tidb_rowid │ Int64           │              │                    │
[2024-04-09T07:08:24.856Z]     └─────────────┴─────────────────┴──────────────┴────────────────────┘

What is changed and how it works?

Add DBGInvoke __refresh_table_schema(test, t2); to sync the latest schema of table

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Apr 26, 2024
@ti-chi-bot ti-chi-bot mentioned this pull request Apr 26, 2024
12 tasks
@ti-chi-bot ti-chi-bot added cherry-pick-approved Cherry pick PR approved by release team. labels Apr 26, 2024
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 26, 2024
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@JaySon-Huang
Copy link
Contributor


[2024-04-26T07:58:37.449Z] 
Stopping fullstack-test2_tiflash0_1 ... error
Stopping fullstack-test2_pd0_1      ... error
Stopping fullstack-test2_tikv0_1    ... error
Stopping fullstack-test2_tidb0_1    ... done
[2024-04-26T07:58:37.450Z] ERROR: for fullstack-test2_tiflash0_1  cannot stop container: d4b144958f9aa41dc8dc7a70a6b7e1035ab9fc9b8aece7ec42c849c0674aa389: tried to kill container, but did not receive an exit event
[2024-04-26T07:58:37.450Z] Removing fullstack-test2_tiflash0_1 ... 
[2024-04-26T07:58:37.450Z] Removing fullstack-test2_tidb0_1    ... 
[2024-04-26T07:58:37.703Z] 
Removing fullstack-test2_tidb0_1    ... done
Removing fullstack-test2_tiflash0_1 ... done
Removing network fullstack-test2_default
[2024-04-26T07:58:37.704Z] error while removing network: network fullstack-test2_default id f5747fe8274021cd809187be876661fc594f791d89fd8a6206eec12b4ca73c2d has active endpoints

/run-all-tests

Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 28, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, JaySon-Huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CalvinNeo,JaySon-Huang]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Apr 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-26 07:07:37.295018849 +0000 UTC m=+330414.034921762: ☑️ agreed by JaySon-Huang.
  • 2024-04-28 07:00:36.348502323 +0000 UTC m=+167790.105637896: ☑️ agreed by CalvinNeo.

@JaySon-Huang
Copy link
Contributor

/run-unit-test

@ti-chi-bot ti-chi-bot bot merged commit 568a838 into pingcap:release-8.1 Apr 28, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants