ddl: rollback read only ddl if meet error | tidb-test=release-8.5.2
What problem does this PR solve?
Issue Number: ref #62122
Problem Summary:
What changed and how does it work?
- In the current implementation, https://github.com/pingcap/tidb/blob/e317c1aeb23eb71bfbda9d4bf5eb83b5e392da42/pkg/ddl/schema.go#L199 will update the dbInfo, but if an error occurs later, there's no rollback logic, we should make sure the read only status keep consistent with the steps before executing DDL in this situation.
- Add a test case about TTL table, in read only database, TTL table delete will fail as expected.
Check List
Tests
- [x] 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
Hi @fzzf678. 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.
Codecov Report
:x: Patch coverage is 62.85714% with 13 lines in your changes missing coverage. Please review.
:warning: Please upload report for BASE (feature/release-8.5-read_only@e317c1a). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## feature/release-8.5-read_only #64951 +/- ##
==================================================================
Coverage ? 77.2515%
==================================================================
Files ? 1642
Lines ? 450593
Branches ? 0
==================================================================
Hits ? 348090
Misses ? 81181
Partials ? 21322
| Flag | Coverage Δ | |
|---|---|---|
| integration | 50.5342% <5.7142%> (?) |
|
| unit | 72.7238% <62.8571%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.9278% <0.0000%> (?) |
|
| parser | ∅ <0.0000%> (?) |
|
| br | 63.0901% <0.0000%> (?) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
/retest
@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
/retest
@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
@joechenrh: adding LGTM is restricted to approvers and reviewers in OWNERS files.
In response to this:
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.
/retest
@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
/retest
@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
/retest
@fzzf678: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: D3Hunter, GMHDBJD, joechenrh
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [D3Hunter,GMHDBJD]
- ~~pkg/ddl/OWNERS~~ [D3Hunter,GMHDBJD]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment