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 zero safepoint make schema gc run repeatly #8361

Merged
merged 6 commits into from
Nov 13, 2023

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Nov 13, 2023

What problem does this PR solve?

Issue Number: close #8356

Problem Summary:

After a new tidb cluster deployed, there is an interval that PD will return gc safepoint with 0

>  tiup ctl:nightly pd -u [10.2.12.81:6540](http://10.2.12.81:6540/) -i
Starting component `ctl`: /DATA/disk1/ra_common/.tiup/components/ctl/v7.6.0-alpha-nightly-20231112/ctl pd -u [10.2.12.81:6540](http://10.2.12.81:6540/) -i
» service-gc-safepoint
{
  "service_gc_safe_points": [
    {
      "service_id": "gc_worker",
      "expired_at": 9223372036854775807,
      "safe_point": 445603590956646400
    }
  ],
  "gc_safe_point": 0 <-- tiflash use this value
}

This will lead to SchemaSyncService::gc running repeatedly. This results in lots of useless logging and getting gc safepoint from pd frequently.

What is changed and how it works?

  • If tiflash receives a gc safepoint == 0 from PD, it skips the schema gc task
  • Refine some logging for adding/removing schema task for keyspace

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 do-not-merge/needs-triage-completed 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. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Nov 13, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger left a comment

Choose a reason for hiding this comment

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

Others LGTM

dbms/src/TiDB/Schema/SchemaSyncService.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 13, 2023
Co-authored-by: Lloyd-Pottiger <60744015+Lloyd-Pottiger@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 13, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JinheLin, 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 [JinheLin,Lloyd-Pottiger]

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

ti-chi-bot bot commented Nov 13, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-13 05:38:39.954357658 +0000 UTC m=+4054717.541467787: ☑️ agreed by Lloyd-Pottiger.
  • 2023-11-13 05:53:36.862128013 +0000 UTC m=+4055614.449238158: ☑️ agreed by JinheLin.

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-unit-test

@ti-chi-bot ti-chi-bot bot merged commit 1addc37 into pingcap:master Nov 13, 2023
@JaySon-Huang JaySon-Huang deleted the fix_safepoint_zero branch November 13, 2023 07:28
@ti-chi-bot
Copy link
Member

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

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not get the gc safepoint from PD for new deployed cluster
4 participants