*: fix CSE keyspace GC safepoint compatibility - #5870
Conversation
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>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. 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>
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>
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>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
| pdClient, err := pd.NewClientWithContext( | ||
| f.ctx, "cdc-factory", pdEndpoints, credential.PDSecurityOption(), | ||
| pdopt.WithMaxErrorRetry(maxGetPDClientRetryTimes), | ||
| pdopt.WithEnableRouterClient(false), |
There was a problem hiding this comment.
What is this used for? Why didn't we need it before?
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>
Signed-off-by: Ping Yu <yuping@pingcap.com>
What problem does this PR solve?
Issue Number: close #5785
Related PD issue: tikv/pd#11108
Problem Summary:
TiCDC SchemaStore can fail to initialize on TiDB Cloud Essential because PD-CSE and client-go select different keyspace transaction safepoints when
GetGCStateis unavailable. PD-CSE returns the keyspace-v2 service safepoint, while client-go falls back to the legacy cluster-level etcd key when CSE keyspace-level GC metadata is not recognized. The resulting stale snapshot causesListDatabasesto fail with error 9006 and blocks changefeed creation.What is changed and how it works?
cdc cli unsafe verify-gc-safepoint --keyspace <name>command that:GCState.TxnSafePointas snapshotS, matching the initial metadata snapshot selected by SchemaStore instead of using the latest TSO.--legacy-safepoint, reads the keyspace-v2 minimum service safepoint throughLegacyClientV2.GetMinServiceSafePointV2and uses it asS.ListDatabasesat snapshotS.Both verifier modes are read-only. They do not create, update, or delete a service safepoint or GC barrier.
Check List
Tests
Commands run:
make fmtgo test ./cmd/cdc/cli -count=1go test -race -shuffle=on ./cmd/cdc/cli -run ^TestVerifyGCSafepoint(Run|Flags)$ -count=1gopls check cmd/cdc/cli/cli_unsafe_verify_gc_safepoint.go cmd/cdc/cli/cli_unsafe_verify_gc_safepoint_test.gomake cdc./bin/cdc cli unsafe verify-gc-safepoint --help./bin/cdc cli unsafe verify-gc-safepoint --legacy-safepoint --no-confirmA live Essential v1 cluster was not available for an end-to-end snapshot read.
Questions
Will it cause performance regression or break compatibility?
No performance regression is expected. The command is hidden and only runs when explicitly invoked. The dependency compatibility changes make client-go use the keyspace-scoped safepoint path for CSE keyspaces.
Do you need to update user documentation, design documentation or monitoring documentation?
No. This is a compatibility fix and unsafe diagnostic command for TiDB Cloud Essential.
Release note