Skip to content

metaservice: support CSE keyspace-level GC - #70322

Closed
pingyu wants to merge 4 commits into
pingcap:masterfrom
pingyu:compat-essential-v1-meta-service
Closed

metaservice: support CSE keyspace-level GC#70322
pingyu wants to merge 4 commits into
pingcap:masterfrom
pingyu:compat-essential-v1-meta-service

Conversation

@pingyu

@pingyu pingyu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #70332

Problem Summary:

Related PD issue: tikv/pd#11108

Related TiCDC incident: pingcap/ticdc#5785

Essential v1 keyspaces advertise keyspace-level GC with safe_point_version=v2. TiDB rejects dedicated meta service groups for those keyspaces because it only recognizes the native gc_management_type=keyspace_level metadata. client-go then cannot use the CSE keyspace-scoped transaction safepoint path, contributing to the safepoint mismatch that blocks TiCDC SchemaStore initialization and changefeed creation.

What changed and how does it work?

  • Use tikv.IsCSEKeyspaceLevelGC in addition to the native PD predicate when validating a dedicated meta service group.
  • Add regression coverage for CSE metadata without gc_management_type.
  • Temporarily pin the client-go fork for the stacked draft; remove the replacement after tikv: support CSE keyspace-level transaction safepoint tikv/client-go#2040 merges.
  • Regenerate DEPS.bzl so Bazel uses the same client-go fork replacement as go.mod.

Check List

Tests

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

Commands run:

  • go test -run ^TestGetGroup$ -tags=intest,deadlock -count=1 -v from pkg/metaservice
  • gopls check pkg/metaservice/metamanager.go pkg/metaservice/metamanager_test.go
  • make bazel_prepare
  • make check-bazel-prepare
  • bazel test --define gotags=intest,deadlock //pkg/metaservice:metaservice_test

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

Support dedicated meta service groups for Essential v1 keyspaces that use keyspace-level GC.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Ping Yu <yuping@pingcap.com>
@ti-chi-bot

ti-chi-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot 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 Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed labels Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3f62e6b-4a0d-4262-ba5b-6e4034a79d17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot

ti-chi-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign cfzjywxk for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Ping Yu <yuping@pingcap.com>
pingyu and others added 2 commits August 5, 2026 10:30
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Ping Yu <yuping@pingcap.com>
@pingyu pingyu changed the title metaservice: support CES keyspace-level GC metaservice: support CSE keyspace-level GC Aug 5, 2026
@pingyu

pingyu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by tikv/pd#11100 commit 31378cb, which extends pd.IsKeyspaceUsingKeyspaceLevelGC to recognize safe_point_version=v2. TiDB #69942 already calls that predicate in metaservice.GetGroup, so the TiDB-specific OR and temporary dependency replacements are unnecessary. Verified the #69942 + client-go#2024 + reviewed PD stack with: GOTOOLCHAIN=go1.25.12 go test -mod=mod -run TestGetGroup -tags=intest,deadlock -count=1.

@pingyu pingyu closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/needs-triage-completed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metaservice: dedicated metadata group is rejected for CSE keyspace-level GC

1 participant