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

test: fix flaky test TestFailSchemaSyncer #54958

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

D3Hunter
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #48758

Problem Summary:

What changed and how does it work?

if after schema validator restart, there is no reload within 200ms which is the ddllease before this pr, schemaValidator.latestSchemaExpire will expire, so later insert will fail with schema changed

do.SchemaValidator.Restart()

        	Error Trace:	/Users/xiedong/repos/tidb/pkg/testkit/testkit.go:157
        	            				/Users/xiedong/repos/tidb/pkg/testkit/testkit.go:150
        	            				/Users/xiedong/repos/tidb/pkg/ddl/tests/partition/db_partition_test.go:2674
        	Error:      	Received unexpected error:
        	            	[domain:8028]Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`. [try again later]
        	            	github.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).checkSchemaValid
        	            		/Users/xiedong/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240626064248-4a72526f6c30/txnkv/transaction/2pc.go:1871
        	            	github.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).execute
        	            		/Users/xiedong/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240626064248-4a72526f6c30/txnkv/transaction/2pc.go:1694
        	            	github.com/tikv/client-go/v2/txnkv/transaction.(*KVTxn).Commit
        	            		/Users/xiedong/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240626064248-4a72526f6c30/txnkv/transaction/txn.go:714
        	            	github.com/pingcap/tidb/pkg/store/driver/txn.(*tikvTxn).Commit
        	            		/Users/xiedong/repos/tidb/pkg/store/driver/txn/txn_driver.go:117
        	            	github.com/pingcap/tidb/pkg/session.(*LazyTxn).Commit
        	            		/Users/xiedong/repos/tidb/pkg/session/txn.go:449
        	            	github.com/pingcap/tidb/pkg/session.(*session).commitTxnWithTemporaryData
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:670
        	            	github.com/pingcap/tidb/pkg/session.(*session).doCommit
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:550
        	            	github.com/pingcap/tidb/pkg/session.(*session).doCommitWithRetry
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:792
        	            	github.com/pingcap/tidb/pkg/session.(*session).CommitTxn
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:922
        	            	github.com/pingcap/tidb/pkg/session.autoCommitAfterStmt
        	            		/Users/xiedong/repos/tidb/pkg/session/tidb.go:281
        	            	github.com/pingcap/tidb/pkg/session.finishStmt
        	            		/Users/xiedong/repos/tidb/pkg/session/tidb.go:243
        	            	github.com/pingcap/tidb/pkg/session.runStmt
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:2320
        	            	github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt
        	            		/Users/xiedong/repos/tidb/pkg/session/session.go:2150
        	            	github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext
        	            		/Users/xiedong/repos/tidb/pkg/testkit/testkit.go:383
        	            	github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext
        	            		/Users/xiedong/repos/tidb/pkg/testkit/testkit.go:155
        	            	github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec
        	            		/Users/xiedong/repos/tidb/pkg/testkit/testkit.go:150
        	            	github.com/pingcap/tidb/pkg/ddl/tests/partition.TestPartitionErrorCode
        	            		/Users/xiedong/repos/tidb/pkg/ddl/tests/partition/db_partition_test.go:2674

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot 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. labels Jul 26, 2024
Copy link

tiprow bot commented Jul 26, 2024

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.0479%. Comparing base (87d1657) to head (fb3b9dc).
Report is 4 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #54958        +/-   ##
================================================
+ Coverage   72.7208%   74.0479%   +1.3270%     
================================================
  Files          1560       1560                
  Lines        438485     438485                
================================================
+ Hits         318870     324689      +5819     
+ Misses        99974      93686      -6288     
- Partials      19641      20110       +469     
Flag Coverage Δ
integration 28.0485% <ø> (?)
unit 71.6515% <ø> (-0.0599%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 52.5355% <ø> (+6.6245%) ⬆️

Copy link
Collaborator

@Benjamin2037 Benjamin2037 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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 26, 2024
Copy link

ti-chi-bot bot commented Jul 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, tangenta

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:

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

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

ti-chi-bot bot commented Jul 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-26 09:41:32.303790691 +0000 UTC m=+1210914.294732162: ☑️ agreed by Benjamin2037.
  • 2024-07-26 09:42:02.106959841 +0000 UTC m=+1210944.097901312: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit d38528a into pingcap:master Jul 26, 2024
22 of 23 checks passed
@D3Hunter D3Hunter deleted the fix48758 branch July 26, 2024 10:27
morgo added a commit to morgo/tidb that referenced this pull request Jul 28, 2024
* upstream/master: (93 commits)
  disjoinset: add generic impl (pingcap#54917)
  planner: derive index filters for mv index paths (pingcap#54877)
  br: cli refactor backup error handling logic (pingcap#54697)
  expression: fix infinity loop in `timestampadd` (pingcap#54916)
  planner: import more expand test. (pingcap#54962)
  planner: use code-gen to generate CloneForPlanCache method for some operators (pingcap#54957)
  test: fix flaky test TestFailSchemaSyncer (pingcap#54958)
  planner: move logical show into logicalop pkg. (pingcap#54928)
  privilege: Remove TestAbnormalMySQLTable (pingcap#54925)
  resource_control: support unlimited keyword when setting the resource group (pingcap#54704)
  ddl: fix a data race on localRowCntListener Written() (pingcap#54484)
  lightning: fix SET SESSION on connection pool (pingcap#54927)
  planner: move logical mem-table to logicalop pkg. (pingcap#54903)
  table: Add `CachedTableSupport` and `TemporaryTableSupport` for `MutateContext` (pingcap#54900)
  executor: fix index_hash_join hang when context canceled (pingcap#54855)
  statistics: add metrics for unneeded analyze table (pingcap#54822)
  *: refine pipelined dml benchmarks (pingcap#54844)
  ddl: assign table IDs for jobs submitted to queue (pingcap#54880)
  *: avoid using Tables field of model.DBInfo, use API instead (pingcap#52302)
  planner: remove useless check (pingcap#54907)
  ...
hawkingrei pushed a commit to hawkingrei/tidb that referenced this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test TestFailSchemaSyncer in pkg/ddl/tests/fail pkg
3 participants