tidb icon indicating copy to clipboard operation
tidb copied to clipboard

ddl: rollback read only ddl if meet error | tidb-test=release-8.5.2

Open fzzf678 opened this issue 3 weeks ago • 12 comments

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

fzzf678 avatar Dec 10 '25 08:12 fzzf678

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.

tiprow[bot] avatar Dec 10 '25 08:12 tiprow[bot]

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.

codecov[bot] avatar Dec 10 '25 08:12 codecov[bot]

/retest

fzzf678 avatar Dec 10 '25 13:12 fzzf678

@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.

tiprow[bot] avatar Dec 10 '25 13:12 tiprow[bot]

/retest

fzzf678 avatar Dec 10 '25 13:12 fzzf678

@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.

tiprow[bot] avatar Dec 10 '25 13:12 tiprow[bot]

@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.

ti-chi-bot[bot] avatar Dec 11 '25 03:12 ti-chi-bot[bot]

/retest

fzzf678 avatar Dec 11 '25 06:12 fzzf678

@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.

tiprow[bot] avatar Dec 11 '25 06:12 tiprow[bot]

/retest

fzzf678 avatar Dec 11 '25 07:12 fzzf678

@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.

tiprow[bot] avatar Dec 11 '25 07:12 tiprow[bot]

/retest

fzzf678 avatar Dec 12 '25 08:12 fzzf678

@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.

tiprow[bot] avatar Dec 12 '25 08:12 tiprow[bot]

[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

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[bot] avatar Dec 15 '25 03:12 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2025-12-12 07:26:00.089201262 +0000 UTC m=+1198704.902978824: :ballot_box_with_check: agreed by D3Hunter.
  • 2025-12-15 03:14:26.354042344 +0000 UTC m=+1442811.167819916: :ballot_box_with_check: agreed by GMHDBJD.

ti-chi-bot[bot] avatar Dec 15 '25 03:12 ti-chi-bot[bot]