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

log-backup: set gc disable when restore log #39729

Merged
merged 6 commits into from
Dec 8, 2022

Conversation

joccau
Copy link
Member

@joccau joccau commented Dec 7, 2022

Signed-off-by: joccau zak.zhao@pingcap.com

What problem does this PR solve?

Issue Number: close #39602

Problem Summary:
The restoring data is gc when pitr. because the process of applying kv-events is concurrent and the kv-events is not sorted by tso.

What is changed and how it works?

  • Disable gc when pitr by set config tikv gc.ratio-threshold= -1.0

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Manual tesst

  1. During PITR
MySQL [(none)]> show config where name = 'gc.ratio-threshold';
+------+-------------------+--------------------+-------+
| Type | Instance          | Name               | Value |
+------+-------------------+--------------------+-------+
| tikv | 172.16.6.47:13460 | gc.ratio-threshold | -1    |
| tikv | 172.16.6.35:3460  | gc.ratio-threshold | -1    |
| tikv | 172.16.6.35:13460 | gc.ratio-threshold | -1    |
| tikv | 172.16.6.46:13460 | gc.ratio-threshold | -1    |
| tikv | 172.16.6.46:3460  | gc.ratio-threshold | -1    |
| tikv | 172.16.6.47:3460  | gc.ratio-threshold | -1    |
+------+-------------------+--------------------+-------+
  1. finish PITR
MySQL [(none)]> show config where name = 'gc.ratio-threshold';
+------+-------------------+--------------------+-------+
| Type | Instance          | Name               | Value |
+------+-------------------+--------------------+-------+
| tikv | 172.16.6.47:3460  | gc.ratio-threshold | 1.1   |
| tikv | 172.16.6.47:13460 | gc.ratio-threshold | 1.1   |
| tikv | 172.16.6.35:3460  | gc.ratio-threshold | 1.1   |
| tikv | 172.16.6.35:13460 | gc.ratio-threshold | 1.1   |
| tikv | 172.16.6.46:13460 | gc.ratio-threshold | 1.1   |
| tikv | 172.16.6.46:3460  | gc.ratio-threshold | 1.1   |
+------+-------------------+--------------------+-------+
  1. admin check table after PITR finished
MySQL [(none)]> admin check table flashback.user_data1;
Query OK, 0 rows affected (1.61 sec)

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.

Disable GC when restore log(PITR) and Enable GC when finish PITR.

Signed-off-by: joccau <zak.zhao@pingcap.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 7, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Leavrth
  • YuJuncen

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 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 7, 2022
Signed-off-by: joccau <zak.zhao@pingcap.com>
br/pkg/utils/db.go Outdated Show resolved Hide resolved
Signed-off-by: joccau <zak.zhao@pingcap.com>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 8, 2022
br/pkg/task/stream.go Outdated Show resolved Hide resolved
br/pkg/utils/db.go Outdated Show resolved Hide resolved
Signed-off-by: joccau <zak.zhao@pingcap.com>
Signed-off-by: joccau <zak.zhao@pingcap.com>
@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. 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 8, 2022
@joccau joccau removed the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Dec 8, 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 Dec 8, 2022
@joccau
Copy link
Member Author

joccau commented Dec 8, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 63a3078

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 8, 2022
@joccau
Copy link
Member Author

joccau commented Dec 8, 2022

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit c21dc26 into pingcap:master Dec 8, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #39763.

@sre-bot
Copy link
Contributor

sre-bot commented Dec 8, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [2] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-common-test 🟥 failed 1, success 16, total 17 19 min New failing
idc-jenkins-ci-tidb/sqllogic-test-1 🟥 failed 1, success 25, total 26 6 min 21 sec New failing
idc-jenkins-ci/integration-cdc-test 🔴 failed 1, success 39, total 40 21 min Existing failure
idc-jenkins-ci-tidb/sqllogic-test-2 ✅ all 28 tests passed 5 min 1 sec Fixed
idc-jenkins-ci-tidb/mybatis-test ✅ all 1 tests passed 4 min 43 sec Fixed
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 10 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 6 min 50 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 5 min 37 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 41 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. size/L Denotes a PR that changes 100-499 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, after flashback, pitr restore data to downstram, data inconsistent with upstream
6 participants