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: backport of (#38738) tidb_ddl_reorg commit conflicts #41115

Merged
merged 9 commits into from
Apr 11, 2023

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented Feb 6, 2023

Manual backport of #38738.

What problem does this PR solve?

Issue Number: close #41118 ref #38669 and #24427 for release-6.5

Problem Summary:

Manual backport, since there where more recent changes and refactoring done, I had to do a manual cherry pick.

What is changed and how it works?

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

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

Fixed cases where errors could be missing when doing DDL and take extra time.

…reorg. (pingcap#38738)

* Added test case

* ddl fix pingcap#38669.

The issue was that mysql.tidb_ddl_reorg table was updated by an
inner transaction after the outer transaction started,
which then made a commit conflict in the outer transaction,
when it deleted the same row.

* Fixed typo in comment

* Added test case for pingcap#24427

* Disabled tests for CI testing

* Revert "Disabled tests for CI testing"

This reverts commit 17c28f3.

* Revert "Revert "Disabled tests for CI testing""

This reverts commit 65c84d9.

* removed test skips

* Clean up the tidb_ddl_reorg entry after DDL is completed

* Use a cleanup job afterwards instead.

* Fixed test

* Moved cleanup before asyncNotify

* More detailed test failure log

* Refined test error message

* Injecting timoeut to get stack traces from CI

* Updated Debug Dump on timeout

* Delete mulitple entries in tidb_ddl_reorg if needed

* Linting

* Linting

* Added CI debug logs

* Linting + CI debugs

* fixed CI debug

* Try to cleanup also if job.State == synced

* check for non-error of runErr instead of error...

* Use a new session, instead of reusing worker.sess

* Also handle case when job == nil

* Removed CI debug logs

* Misssed change session from w.sess to newly created sess

* Improved TestConcurrentDDLSwitch and added CI debug logs

* Always cleaning up all orphan mysql.tidb_ddl_reorg entries

* linting

* Also cleanup if job is nil

* Updated TestModifyColumnReorgInfo + CI debug logs

* more CI debug

* refactored the cleanupDDLReorgHandle code

* Added missing cleanup in handleDDLJobQueue

* Removed debug panic

* Code cleanup

* Test updates

* Debug cleanup

* Cleaned up test after removal of old non-concurrent DDL code merge

* Linting

* always wrap changes to tidb_ddl_reorg in an own transaction

+ fixed some typos

* Minimum fix

* Always update reorg meta, not only on error

* Issue is here :)

* Fixed newReorgHandler

* Wrapped more tidb_ddl_reorg changes into separate transactions

* linting

* Removed updateDDLReorgStartHandle

* cleanups

* Made runInTxn a method on *session, instead of normal function

* Update test

* Final touches

* Removed duplicate test

* CleanupDDLReorgHandles should only be called from HandleJobDone.

* Variable rename

* Renamed 'delete' variabel name

* Updated test

* small revert

* Removed timeout debugging code

* Simplified the cleanup to only start a new txn and not a new session

* Reverted the change of GetDDLInfo

Co-authored-by: Ti Chi Robot <[email protected]>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 6, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Benjamin2037
  • hawkingrei

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 6, 2023
@mjonss
Copy link
Contributor Author

mjonss commented Feb 7, 2023

/retest

@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Feb 7, 2023
@wjhuang2016
Copy link
Member

/retest

1 similar comment
@mjonss
Copy link
Contributor Author

mjonss commented Feb 13, 2023

/retest

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 16, 2023
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2023
@mjonss
Copy link
Contributor Author

mjonss commented Feb 22, 2023

/retest

1 similar comment
@wjhuang2016
Copy link
Member

/retest

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 added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 2, 2023
@wjhuang2016
Copy link
Member

/retest

@VelocityLight VelocityLight added do-not-merge/cherry-pick-not-approved cherry-pick-approved Cherry pick PR approved by release team. and removed cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/cherry-pick-not-approved labels Mar 3, 2023
@mjonss
Copy link
Contributor Author

mjonss commented Mar 16, 2023

/retest

2 similar comments
@mjonss
Copy link
Contributor Author

mjonss commented Mar 16, 2023

/retest

@mjonss
Copy link
Contributor Author

mjonss commented Mar 16, 2023

/retest

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 10, 2023
@bb7133
Copy link
Member

bb7133 commented Apr 10, 2023

/retest

1 similar comment
@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/retest

@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/retest

2 similar comments
@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/retest

@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/retest

@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: dc5dbaf

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 10, 2023
@mjonss
Copy link
Contributor Author

mjonss commented Apr 10, 2023

/retest

2 similar comments
@mjonss
Copy link
Contributor Author

mjonss commented Apr 11, 2023

/retest

@hawkingrei
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Apr 11, 2023
@mjonss
Copy link
Contributor Author

mjonss commented Apr 11, 2023

/retest

@wjhuang2016
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 96f8a1f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 11, 2023
@ti-chi-bot ti-chi-bot merged commit cee7565 into pingcap:release-6.5 Apr 11, 2023
@mjonss mjonss deleted the cherry-pick-38738-6.5 branch April 11, 2023 14:28
@ti-chi-bot
Copy link
Member

@mjonss: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test 7662330 link true /test unit-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants