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

br: restore tiflash replica count after PiTR #37181

Merged
merged 21 commits into from
Aug 25, 2022

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Aug 17, 2022

What problem does this PR solve?

Issue Number: close #37208

Problem Summary:
Currently, we cannot restore the information of TiFlash replicas.

What is changed and how it works?

This PR added some hooks to the PiTR restore process, and would collect the tilfash-related infromation and then generate and execute those DDLs for restoring the TiFlash replicas.

Check List

Tests

[["310000", "154946.6817939191110397"], ["310000", "154947.6057966217137621"], ["310000", "154820.4573007339340533"]] 
vs 
[["310000", "154946.6817939191110397"], ["310000", "154947.6057966217137621"], ["310000", "154820.4573007339340533"]]; 
equals? = true

TiFlash replica matches:

irb(main):005:0> (SQL.new :downstream).sql 'select * from information_schema.tiflash_replica'
=> [["test", "table4", "215", "1", "", "1", "1", "NORMAL"], ["test", "table3", "216", "1", "", "1", "1", "NORMAL"]]
irb(main):006:0> SQL.new.sql 'select * from information_schema.tiflash_replica'
=> [["test", "table4", "193", "1", "", "1", "1", "NORMAL"], ["test", "table3", "196", "1", "", "1", "1", "NORMAL"]]
  • No code

Release note

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

PiTR (Log Backup) can restore TiFlash replica metadata now.

Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Leavrth
  • joccau

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 do-not-merge/invalid-title 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. labels Aug 17, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Aug 17, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Aug 17, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 17, 2022

Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 18, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Aug 18, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
@YuJuncen YuJuncen changed the title Test tiflash fix br: restore tiflash replica count after PiTR Aug 18, 2022
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
@joccau joccau requested a review from Leavrth August 24, 2022 02:42
@joccau
Copy link
Member

joccau commented Aug 24, 2022

/cc @3pointer @Leavrth PTAL

@ti-chi-bot
Copy link
Member

@joccau: GitHub didn't allow me to request PR reviews from the following users: PTAL.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @3pointer @Leavrth PTAL

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.

Copy link
Member

@joccau joccau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM.

br/pkg/restore/tiflashrec/tiflash_recorder.go Show resolved Hide resolved
br/pkg/task/stream.go Show resolved Hide resolved
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Signed-off-by: Yu Juncen <yujuncen@pingcap.com>
Copy link
Member

@joccau joccau 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 Aug 25, 2022
@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 Aug 25, 2022
@joccau
Copy link
Member

joccau commented Aug 25, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 1ddeb4f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 25, 2022
@ti-chi-bot ti-chi-bot merged commit f16f52c into pingcap:master Aug 25, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Aug 25, 2022

TiDB MergeCI notify

✅ Well Done! New fixed [1] after this pr merged.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/common-test 🔴 failed 1, success 10, total 11 16 min Existing failure
idc-jenkins-ci-tidb/integration-common-test ✅ all 17 tests passed 17 min Fixed
idc-jenkins-ci/integration-cdc-test 🟢 all 36 tests passed 35 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 9 min 6 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 7 min 8 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 6 min 40 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 6 min 8 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 30 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 24 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

morgo added a commit to morgo/tidb that referenced this pull request Aug 27, 2022
…verage

* upstream/master: (109 commits)
  *: rename TemporaryTableAttachedInfoSchema (pingcap#37408)
  *: enable noloopclosure (pingcap#37153)
  executor: add JSON opaque value condition to everywhere (pingcap#37390)
  *: refine mock session manager (pingcap#37400)
  lightning: check counter value to make code more robust (pingcap#37380)
  *: use go 1.19 (pingcap#36223)
  br: restore tiflash replica count after PiTR (pingcap#37181)
  testkit,executor: add MustQueryWitnContext API and fix unstable test TestCoprocessorPriority (pingcap#37382)
  executor: add conversion to opaque value for json_objectagg and json_arrayagg (pingcap#37337)
  expression: quote json path if necessarily (pingcap#37375)
  *: support ACCOUNT (UN)LOCK when creating/altering user (pingcap#37052)
  log-backup: support the ddl(exchange partition) when PiTR  (pingcap#37050)
  *: change `integration.BeforeTest` to `integration.BeforeTestExternal` to avoid skip tests (pingcap#37341)
  executor: fix unstable TestGlobalMemoryTrackerOnCleanUp (pingcap#37372)
  util/ranger: avoid building ranges twice in detachCNFCondAndBuildRangeForIndex (pingcap#37177)
  statistics: track used stats status during query (pingcap#37101)
  *: fix data race in `TestTiFlashGroupIndexWhenStartup` (pingcap#37371)
  lightning: fix dpanic log when init session vars (pingcap#37301)
  executor: let plan replayer record table tiflash replica (pingcap#37336)
  types: fix a bug in casting str2str when `union` (pingcap#37242)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ 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.

br: support restore tiflash replicas
5 participants