tidb
tidb copied to clipboard
[DNM]GC: Support keyspace level GC
What problem does this PR solve?
Issue Number: ref https://github.com/pingcap/tidb/issues/51593
Problem Summary:
What changed and how does it work?
Check List
Tests
- [x] Manual test (add detailed scripts or steps below)
-
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 -
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
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.
Codecov Report
Attention: Patch coverage is 48.02867% with 145 lines in your changes missing coverage. Please review.
Project coverage is 74.2527%. Comparing base (
0f0418f) to head (c543d86). Report is 916 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #51300 +/- ##
================================================
+ Coverage 72.4015% 74.2527% +1.8512%
================================================
Files 1483 1524 +41
Lines 429016 442233 +13217
================================================
+ Hits 310614 328370 +17756
+ Misses 99108 93204 -5904
- Partials 19294 20659 +1365
| Flag | Coverage Δ | |
|---|---|---|
| integration | 50.1939% <31.8996%> (?) |
|
| unit | 71.2173% <42.6523%> (-0.0304%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 53.9957% <ø> (ø) |
|
| parser | ∅ <ø> (∅) |
|
| br | 52.7771% <ø> (+11.5655%) |
:arrow_up: |
/test check-dev2
@ystaticy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
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.
/ok-to-test
/test unit-test
@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 unit-test
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.
/test unit-test
@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 unit-test
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.
/retest
/test check-dev2
@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.
/test all
/test fast_test_tiprow
@ystaticy: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test build/test check-dev/test check-dev2/test mysql-test/test pull-br-integration-test/test pull-integration-ddl-test/test pull-lightning-integration-test/test pull-mysql-client-test/test unit-test
The following commands are available to trigger optional jobs:
/test canary-notify-when-compatibility-sections-changed/test pingcap/tidb/canary_ghpr_unit_test/test pull-common-test/test pull-e2e-test/test pull-integration-common-test/test pull-integration-copr-test/test pull-integration-jdbc-test/test pull-integration-mysql-test/test pull-integration-nodejs-test/test pull-sqllogic-test/test pull-tiflash-test
Use /test all to run the following jobs that were automatically triggered:
pingcap/tidb/ghpr_buildpingcap/tidb/ghpr_checkpingcap/tidb/ghpr_check2pingcap/tidb/ghpr_mysql_testpingcap/tidb/ghpr_unit_testpingcap/tidb/pull_integration_ddl_testpingcap/tidb/pull_mysql_client_test
In response to this:
/test fast_test_tiprow
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.
/test tidb_parser_test
@ystaticy: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test build/test check-dev/test check-dev2/test mysql-test/test pull-br-integration-test/test pull-integration-ddl-test/test pull-lightning-integration-test/test pull-mysql-client-test/test unit-test
The following commands are available to trigger optional jobs:
/test canary-notify-when-compatibility-sections-changed/test pingcap/tidb/canary_ghpr_unit_test/test pull-common-test/test pull-e2e-test/test pull-integration-common-test/test pull-integration-copr-test/test pull-integration-jdbc-test/test pull-integration-mysql-test/test pull-integration-nodejs-test/test pull-sqllogic-test/test pull-tiflash-test
Use /test all to run the following jobs that were automatically triggered:
pingcap/tidb/ghpr_buildpingcap/tidb/ghpr_checkpingcap/tidb/ghpr_check2pingcap/tidb/ghpr_mysql_testpingcap/tidb/ghpr_unit_testpingcap/tidb/pull_integration_ddl_testpingcap/tidb/pull_mysql_client_test
In response to this:
/test tidb_parser_test
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: 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 tidb_parser_test
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.
/test all
/test check-dev2
@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.
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@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.
/test check-dev
PR needs rebase.
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: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-lightning-integration-test | c543d869edb7da7d964767497b030f2386ea4c70 | link | true | /test pull-lightning-integration-test |
Full PR test history. Your PR dashboard.
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. I understand the commands that are listed here.