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: Support FLASHBACK DATABASE (release-7.1) #8449

Merged

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Dec 1, 2023

What problem does this PR solve?

Issue Number: close #8450

Problem Summary:
tidb support FLASHBACK DATABASE DBName [TO newDBName] since v6.4.0 https://docs.pingcap.com/tidb/stable/sql-statement-flashback-database
However, tiflash did not notice that. And if a database is recovered by FLASHBACK DATABASE, tiflash can not prevent the data from being removed after gc-safepoint advanced

What is changed and how it works?

Recover all the tables on the database when FLASHBACK DATABASE is executed

Note that the implementation is different from that on master, release-7.5. And it can not handle some (rare) cases that raft-logs come after the database is dropped.

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

Fix the issue that `FLASHBACK DATABASE` is not applied to TiFlash replica data

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/cherry-pick-not-approved size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 1, 2023
@JaySon-Huang JaySon-Huang changed the title ddl: Support flashback database (release-7.1) ddl: Support FLASHBACK DATABASE (release-7.1) Dec 1, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 1, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Dec 1, 2023
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 1, 2023
@JaySon-Huang
Copy link
Contributor Author

/hold
need to sync some changes with the master branch PR

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 4, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

https://ci.pingcap.net/blue/organizations/jenkins/tiflash-ghpr-integration-tests/detail/tiflash-ghpr-integration-tests/15305/pipeline/

[2023-12-04T08:40:43.881Z]   File: fullstack-test2/ddl/multi_alter_with_write.test
[2023-12-04T08:40:43.881Z]   Error line: 472
[2023-12-04T08:40:43.881Z]   Error: DBGInvoke query_mapped('select * from \$d.\$t', test, t)
[2023-12-04T08:40:43.881Z]   Result:
[2023-12-04T08:40:43.881Z]     Received exception from server (version 1.1.54381):
[2023-12-04T08:40:43.881Z]     Code: 0. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Can not find channel for fail point pause_query_init.
[2023-12-04T08:40:43.881Z]   Expected:
[2023-12-04T08:40:43.881Z]     ┌─a───┬─c─────┬─d───┬─e───┐
[2023-12-04T08:40:43.881Z]     │ 1   │ abc   │ 0   │ \N  │
[2023-12-04T08:40:43.881Z]     │ 3   │ ccc   │ 3   │ 0.1 │
[2023-12-04T08:40:43.881Z]     └─────┴───────┴─────┴─────┘

@JaySon-Huang
Copy link
Contributor Author

/run-integration-test

@JaySon-Huang
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

ti-chi-bot bot commented Dec 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongyunyan, Lloyd-Pottiger

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:
  • OWNERS [Lloyd-Pottiger,hongyunyan]

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 Dec 7, 2023
Copy link
Contributor

ti-chi-bot bot commented Dec 7, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-01 13:54:53.417048471 +0000 UTC m=+1190122.082274651: ☑️ agreed by Lloyd-Pottiger.
  • 2023-12-07 03:55:34.64140549 +0000 UTC m=+1672563.306631685: ☑️ agreed by hongyunyan.

@ti-chi-bot ti-chi-bot bot merged commit 2775201 into pingcap:release-7.1 Dec 7, 2023
5 checks passed
@JaySon-Huang JaySon-Huang deleted the support_flashback_database_7.1 branch December 7, 2023 05:14
@JaySon-Huang
Copy link
Contributor Author

/cherry-pick release-6.5

@ti-chi-bot
Copy link
Member

@JaySon-Huang: new pull request created to branch release-6.5: #8479.

In response to this:

/cherry-pick release-6.5

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 ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Dec 7, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants