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

ddl: fix unstable test TestCreateDropCreateTable #50076

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Jan 4, 2024

What problem does this PR solve?

Issue Number: close #50061

Problem Summary:

There is a gap between runningJobs.remove() and next runningJobs.add(). If getJob() is invoked during this gap, DDL worker may execute the second create table job first.

What changed and how does it work?

This PR distinguishes the concept between "processing" jobs and "unfinished" jobs:

  • Processing jobs: activatly running by a DDL worker.
  • Unfinished jobs: the jobs whose state is NOT synced, done, or rollback done.

For checkRunnable(), we should use "unfinished jobs" to determine the dependency.

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 do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 4, 2024
Copy link

tiprow bot commented Jan 4, 2024

Hi @tangenta. 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/test-infra repository.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Merging #50076 (2089e71) into master (c128a2d) will increase coverage by 2.0105%.
Report is 6 commits behind head on master.
The diff coverage is 90.9090%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50076        +/-   ##
================================================
+ Coverage   70.7820%   72.7926%   +2.0105%     
================================================
  Files          1467       1467                
  Lines        436396     437267       +871     
================================================
+ Hits         308890     318298      +9408     
+ Misses       108168      98944      -9224     
- Partials      19338      20025       +687     
Flag Coverage Δ
integration 48.9578% <88.6363%> (?)
unit 70.4748% <88.6363%> (-0.1079%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.4462% <ø> (+5.5748%) ⬆️

@tangenta
Copy link
Contributor Author

tangenta commented Jan 4, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 4, 2024
@tangenta
Copy link
Contributor Author

tangenta commented Jan 4, 2024

/retest

1 similar comment
@tangenta
Copy link
Contributor Author

tangenta commented Jan 5, 2024

/retest

@wuhuizuo wuhuizuo marked this pull request as draft January 8, 2024 08:54
@tangenta
Copy link
Contributor Author

tangenta commented Jan 9, 2024

/retest

@tangenta tangenta marked this pull request as ready for review January 9, 2024 09:09
@tangenta
Copy link
Contributor Author

tangenta commented Jan 9, 2024

@wuhuizuo I need to trigger CI to reproduce the issue.

@tangenta
Copy link
Contributor Author

/run-unit-test

@tangenta tangenta force-pushed the test-fix-ut-create-drop-create branch from 1e6ac4a to 93082a4 Compare February 18, 2024 09:58
@tangenta tangenta force-pushed the test-fix-ut-create-drop-create branch from 68af0d4 to 66ed429 Compare March 7, 2024 08:51
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2024
@tangenta tangenta changed the title [WIP] ddl: fix unstable test TestCreateDropCreateTable ddl: fix unstable test TestCreateDropCreateTable Mar 7, 2024
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed labels Mar 7, 2024
@ti-chi-bot ti-chi-bot bot added the approved label Mar 7, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 7, 2024
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, wjhuang2016

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 Mar 7, 2024
Copy link

ti-chi-bot bot commented Mar 7, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-07 15:52:48.484469112 +0000 UTC m=+355195.506715500: ☑️ agreed by wjhuang2016.
  • 2024-03-07 19:45:27.964956004 +0000 UTC m=+369154.987202391: ☑️ agreed by bb7133.

@ti-chi-bot ti-chi-bot bot merged commit bc84197 into pingcap:master Mar 7, 2024
23 checks passed
@tangenta tangenta added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label May 28, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53635.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test TestCreateDropCreateTable
4 participants