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

[DNM]GC: Support keyspace level GC #51300

Open
wants to merge 99 commits into
base: master
Choose a base branch
from

Conversation

ystaticy
Copy link
Contributor

@ystaticy ystaticy commented Feb 26, 2024

What problem does this PR solve?

Issue Number: ref #51593

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  1. set keyspace level gc when create Keyspace:
    1.1. create new keyspace with keyspace level gc:

    curl -H "Content-Type: application/json" -X POST -d \
    '{
        "name": "ks1",
        "config": {
            "gc_management_type": "keyspace_level_gc"
        }
    }' "http://127.0.0.1:2379/pd/api/v2/keyspaces"
    

    Get keyspace meta:

    curl "http://127.0.0.1:2379/pd/api/v2/keyspaces/ks1"
    {
        "id": 1,
        "name": "ks1",
        "state": "ENABLED",
        "created_at": 1712126594,
        "state_changed_at": 1712126594,
        "config": {
            "gc_management_type": "keyspace_level_gc"
        }
    }
    

    1.2. Start TiDB and check the etcd key
    You can see that the ETCD key of safe point and min start ts in pd is separated by Keyspace:

    1.minstartts
    /keyspaces/tidb/1/tidb/server/minstartts/1fbc785c-dada-4152-a2e7-f0534a386e6e
    
    2.saved safe point
    /keyspaces/tidb/1/tidb/store/gcworker/saved_safe_point
    
    4.gc safe point 
    /pd/7340112560849754553/keyspaces/gc_safe_point/00000001
    
    5.service safe point 
    /pd/7340112560849754553/keyspaces/service_safe_point/00000001/gc_worker
    
  2. Check that PD's ETCD key remains in its original format without Keyspace set:

    1. minstartts
    /tidb/server/minstartts/f8545873-a97a-4aaf-be10-53633490b339
    
    2. saved safe point 
    /tidb/store/gcworker/saved_safe_point
    
    3. gc safe point
    /pd/7340566695597925295/gc/safe_point
    
    4. service safe point 
    /pd/7340566695597925295/gc/safe_point/service/gc_worker
    

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.

Support TiDB server with different keyspace to advance GC safe point separately

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 26, 2024
Copy link

tiprow bot commented Feb 26, 2024

Hi @ystaticy. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

@ystaticy ystaticy closed this Feb 27, 2024
@ystaticy ystaticy reopened this Feb 27, 2024
@ti-chi-bot ti-chi-bot 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 Feb 28, 2024
@ti-chi-bot ti-chi-bot 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 Mar 6, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 42.50000% with 161 lines in your changes missing coverage. Please review.

Project coverage is 74.7151%. Comparing base (0374ae2) to head (a29b940).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51300        +/-   ##
================================================
+ Coverage   72.8615%   74.7151%   +1.8535%     
================================================
  Files          1677       1722        +45     
  Lines        464138     472456      +8318     
================================================
+ Hits         338178     352996     +14818     
+ Misses       105082      97261      -7821     
- Partials      20878      22199      +1321     
Flag Coverage Δ
integration 49.1981% <3.2142%> (?)
unit 72.2169% <42.5000%> (-0.0366%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 61.1606% <ø> (+15.4570%) ⬆️

@ti-chi-bot ti-chi-bot bot added the component/dumpling This is related to Dumpling of TiDB. label Mar 7, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 7, 2024
@ystaticy
Copy link
Contributor Author

ystaticy commented Mar 7, 2024

/test check-dev2

Copy link

tiprow bot commented Apr 30, 2024

@ystaticy: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

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

ti-chi-bot bot commented May 6, 2024

@AmoebaProtozoa: adding LGTM is restricted to approvers and reviewers in OWNERS files.

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 kubernetes/test-infra repository.

@ystaticy
Copy link
Contributor Author

ystaticy commented May 6, 2024

/test check-dev

@ti-chi-bot ti-chi-bot 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 May 6, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 6, 2024
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 12, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2024
Copy link

ti-chi-bot bot commented Nov 18, 2024

@baiyuqing: adding LGTM is restricted to approvers and reviewers in OWNERS files.

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 kubernetes/test-infra repository.

Copy link

ti-chi-bot bot commented Nov 18, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AmoebaProtozoa, baiyuqing
Once this PR has been reviewed and has the lgtm label, please assign tangenta for approval. For more information see the Code Review Process.

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

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

@baiyuqing
Copy link

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. ok-to-test Indicates a PR is ready to be tested. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants