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: add the switch for log backup #36115

Merged
merged 19 commits into from
Jul 15, 2022

Conversation

3pointer
Copy link
Contributor

@3pointer 3pointer commented Jul 12, 2022

What problem does this PR solve?

Issue Number: ref #29501

Problem Summary:
we have several places need to check whether log backup is enabled.

  1. Resolve locks to scan more locks after safepoint.
  2. Add index to skip using lightning.
  3. Telemetry of log backup feature usage statistics.

What is changed and how it works?

  1. Add a switch for log backup is enabled.
  2. remove the old logic that check log backup config from http client.
  3. This PR also fix two unstable test(owner_test, ddl_test) to make CI passed.

Check List

Tests

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

when cluster not enable log backup or don't have the config log-backup.enable.
截屏2022-07-14 下午2 53 25

when enable to true.
image

  • 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

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

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YuJuncen
  • 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/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Jul 12, 2022
@3pointer 3pointer force-pushed the add_switch_for_logbackup branch from eb4b4a8 to b0f2213 Compare July 12, 2022 05:11
@3pointer 3pointer changed the title log-backup: add switch for log backup log-backup: add the switch for log backup Jul 12, 2022
@3pointer 3pointer requested a review from joccau July 12, 2022 05:13
@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 Jul 12, 2022
@3pointer 3pointer force-pushed the add_switch_for_logbackup branch from c540ca8 to d967eee Compare July 12, 2022 07:28
@3pointer 3pointer force-pushed the add_switch_for_logbackup branch from b4c72d9 to b9a2395 Compare July 12, 2022 09:02
@3pointer 3pointer force-pushed the add_switch_for_logbackup branch from 8fcac45 to 96c7dab Compare July 12, 2022 12:11
@sre-bot
Copy link
Contributor

sre-bot commented Jul 12, 2022

@3pointer 3pointer marked this pull request as ready for review July 13, 2022 02:23
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2022
@3pointer 3pointer force-pushed the add_switch_for_logbackup branch from bbbea79 to 74e5299 Compare July 14, 2022 06:16
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 14, 2022
@@ -609,6 +609,16 @@ func (w *worker) writePhysicalTableRecord(t table.PhysicalTable, bfWorkerType ba
}()
jc := w.jobContext(job)

// ctx, err := w.sessPool.get()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Benjamin2037 Please help review this usage.

@@ -25,6 +25,7 @@ func TestMain(m *testing.M) {
testsetup.SetupForCommonTest()
opts := []goleak.Option{
goleak.IgnoreTopFunction("github.com/golang/glog.(*loggingT).flushDaemon"),
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hawkingrei Please help review this fix of unit test.

@@ -47,6 +48,7 @@ type featureUsage struct {
NonTransactionalUsage *m.NonTransactionalStmtCounter `json:"nonTransactional"`
GlobalKill bool `json:"globalKill"`
MultiSchemaChange *m.MultiSchemaChangeUsageCounter `json:"multiSchemaChange"`
LogBackup bool `json:"logBackup"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AstroProfundis Please help review this change.

Copy link
Contributor

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 14, 2022
@3pointer
Copy link
Contributor Author

/run-integration-br-tests

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 14, 2022
@3pointer
Copy link
Contributor Author

/hold for more reviewers

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 14, 2022
Copy link
Contributor

@sticnarf sticnarf left a comment

Choose a reason for hiding this comment

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

The gc worker part lgtm.

@ti-chi-bot
Copy link
Member

@AstroProfundis: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

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

@3pointer
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 15, 2022
@3pointer
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 6e512cc

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

sre-bot commented Jul 15, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] 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-ddl-test 🟥 failed 1, success 5, total 6 8 min 29 sec New failing
idc-jenkins-ci-tidb/tics-test 🔴 failed 1, success 0, total 1 6 min 59 sec Existing failure
idc-jenkins-ci/integration-cdc-test 🟢 all 36 tests passed 28 min Existing passed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 11 tests passed 25 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 15 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 9 min 37 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 7 min 18 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 6 min 7 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 25 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
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 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.

7 participants