Skip to content

tikv: support CES keyspace-level transaction safepoint - #2039

Closed
pingyu wants to merge 9 commits into
tikv:masterfrom
pingyu:compat-essential-v1-txn-safepoint
Closed

tikv: support CES keyspace-level transaction safepoint#2039
pingyu wants to merge 9 commits into
tikv:masterfrom
pingyu:compat-essential-v1-txn-safepoint

Conversation

@pingyu

@pingyu pingyu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Essential v1 keyspaces advertise keyspace-level GC with safe_point_version=v2, while client-go only recognizes the native gc_management_type=keyspace_level metadata. The compatibility transaction safepoint loader therefore reads the unified GC key instead of the keyspace-scoped key.

What is changed and how it works?

  • Route both native and Essential v1 keyspace-level GC metadata to /keyspaces/tidb/{id}/tidb/store/gcworker/saved_safe_point.
  • Keep all other keyspaces on the unified GC key.
  • Add focused coverage for nil, native, Essential v1, and unified metadata.

Stack dependencies

Tests

  • go test ./tikv -run ^TestCompatibleTxnSafePointPath$ -count=1 -v
  • gopls check tikv/compatible_txn_safe_point_loader.go tikv/compatible_txn_safe_point_loader_test.go

The full go test ./tikv -count=1 currently hits the same mockstore teardown nil-pointer panic in KVStore.updateSafeTS on the clean #2024 stacked base; the focused changed behavior passes.

disksing and others added 9 commits July 20, 2026 13:50
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
# Conflicts:
#	examples/gcworker/go.mod
#	examples/rawkv/go.mod
#	examples/txnkv/1pc_txn/go.mod
#	examples/txnkv/async_commit/go.mod
#	examples/txnkv/delete_range/go.mod
#	examples/txnkv/go.mod
#	examples/txnkv/pessimistic_txn/go.mod
#	examples/txnkv/unsafedestoryrange/go.mod
#	go.mod
#	go.sum
#	integration_tests/go.mod
#	integration_tests/go.sum
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
…-v1-txn-safepoint

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>
@ti-chi-bot ti-chi-bot Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 3, 2026
@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 the dco-signoff: yes Indicates the PR's author has signed the dco. label Aug 3, 2026
@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 innerr 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

@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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a4c7dd58-68ce-4d27-9f52-677a6d4f7e77

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 added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 3, 2026
@pingyu

pingyu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #2040, which implements the CES predicate locally and avoids the API-v3 dependency blast while retaining tikv/pd#11100 as the canonical PD helper.

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

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants