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 snap after dropping database #8560

Merged
merged 9 commits into from
Dec 22, 2023

Conversation

JaySon-Huang
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #8506

Problem Summary:

Introduced by #8536. In that PR, we don't check whether the DatabaseInfo exist when creating a Storage instance.

However, if the DDL "create database" and decoding raftlog or snapshot comes after TiDB executed "drop database". Then applyCreateStorageInstance can not handle it because the IDatabase instance is not created in TiFlash.

What is changed and how it works?

In order to resolve the DatabaseInfo can not be fetched from TiKV, we will construct a "fake" DatabaseInfo and create the IDatabase instance in TiFlash. Because

  • If the database is not FLASHBACK, then we don't care its display name in TiFlash, we just need it for storing the raft log / snapshot data
  • If the database is FLASHBACK later, then the DatabaseInfo will be overwritten

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

None

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. labels Dec 21, 2023
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 21, 2023
@JaySon-Huang JaySon-Huang changed the title ddl: Fix snap after drop db ddl: Fix snap after dropping database Dec 21, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 21, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@hongyunyan hongyunyan 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 bot added the lgtm label Dec 22, 2023
Copy link
Contributor

ti-chi-bot bot commented Dec 22, 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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 22, 2023
Copy link
Contributor

ti-chi-bot bot commented Dec 22, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-21 08:11:02.173747579 +0000 UTC m=+1121353.210974505: ☑️ agreed by Lloyd-Pottiger.
  • 2023-12-22 06:23:50.942701608 +0000 UTC m=+1201321.979928535: ☑️ agreed by hongyunyan.

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@Lloyd-Pottiger
Copy link
Contributor

/run-integration-test

@JaySon-Huang
Copy link
Contributor Author

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

[2023-12-22T07:45:35.409Z] fullstack-test/mpp/async_server_alarm.test: Running
[2023-12-22T07:46:24.648Z]   File: fullstack-test/mpp/async_server_alarm.test
[2023-12-22T07:46:24.648Z]   Error line: 58
[2023-12-22T07:46:24.648Z]   Error: use test; set @@tidb_isolation_read_engines='tiflash'; set @@tidb_allow_mpp=1; select count(value), id from t group by id;
[2023-12-22T07:46:24.648Z]   Result:
[2023-12-22T07:46:24.648Z]     ERROR 1105 (HY000) at line 1: rpc error: code = Unavailable desc = keepalive ping failed to receive ACK within timeout
[2023-12-22T07:46:24.648Z]   Expected:
[2023-12-22T07:46:24.648Z]     {#REGEXP}.*Can't find task*

@JaySon-Huang
Copy link
Contributor Author

/run-integration-test

1 similar comment
@JaySon-Huang
Copy link
Contributor Author

/run-integration-test

Copy link
Contributor

ti-chi-bot bot commented Dec 22, 2023

@JaySon-Huang: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-chi-bot bot merged commit 4d92520 into pingcap:master Dec 22, 2023
6 checks passed
@ti-chi-bot
Copy link
Member

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

@JaySon-Huang JaySon-Huang deleted the fix_snap_after_drop_db branch December 23, 2023 04:37
ti-chi-bot bot pushed a commit that referenced this pull request Dec 27, 2023
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Dec 27, 2023
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. 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.

Unstable tests fullstack-test2/ddl/flashback/flashback_database.test
4 participants