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 97 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

Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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 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.

Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ystaticy ystaticy closed this Feb 27, 2024
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ystaticy ystaticy reopened this Feb 27, 2024
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 48.02867% with 145 lines in your changes are missing coverage. Please review.

Project coverage is 73.9830%. Comparing base (0f0418f) to head (c543d86).
Report is 14 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51300        +/-   ##
================================================
+ Coverage   72.4015%   73.9830%   +1.5815%     
================================================
  Files          1483       1499        +16     
  Lines        429016     434470      +5454     
================================================
+ Hits         310614     321434     +10820     
+ Misses        99108      93159      -5949     
- Partials      19294      19877       +583     
Flag Coverage Δ
integration 49.0675% <31.8996%> (?)
unit 71.2173% <42.6523%> (-0.0304%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 44.3260% <ø> (+3.1144%) ⬆️

Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ti-chi-bot ti-chi-bot bot added the component/dumpling This is related to Dumpling of TiDB. label Mar 7, 2024
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ystaticy
Copy link
Contributor Author

ystaticy commented Mar 7, 2024

/test check-dev2

@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 Apr 29, 2024
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 29, 2024
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@ystaticy
Copy link
Contributor Author

/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.

Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Copy link

ti-chi-bot bot commented May 6, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AmoebaProtozoa
Once this PR has been reviewed and has the lgtm label, please assign wjhuang2016 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

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

Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@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
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 release-note 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.

None yet

5 participants