Skip to content

Conversation

@MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented May 7, 2025

What problem does this PR solve?

Issue Number: Close #8978

What is changed and how does it work?

This PR migrates the old GC APIs to the new implementation, and marks them as deprecated.
Also suppresses warnings on necessary invocations to them, such as tests.

Check List

Tests

  • Unit test

Code changes

-

Side effects

  • Possible performance regression
  • Increased code complexity

Related changes

Release note

None.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 7, 2025

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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has signed the dco. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 7, 2025
@MyonKeminta MyonKeminta changed the title grpc_service, client: Deprecate old GC related APIs server, client: Deprecate old GC related APIs May 7, 2025
@MyonKeminta MyonKeminta mentioned this pull request May 8, 2025
24 tasks
ti-chi-bot bot added a commit that referenced this pull request Jul 3, 2025
… keyspace is configured (#9468)

close #8978

client: Remove public v2 client and redirect call to v2 internally if keyspace is configured

Removes the GC V2 related public APIs from PD client to avoid being used by new code. This is a temporary approach, and #9292 will give a complete deprecation.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta MyonKeminta force-pushed the m/deprecate-old-gc-api branch from 22756d8 to 579bbb5 Compare July 11, 2025 10:02
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

/test all

@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/test all

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

/retest

2 similar comments
@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta MyonKeminta marked this pull request as ready for review July 17, 2025 09:23
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2025
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/retest

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Header: wrapHeader(),
GcSafePoints: gcSafePoints,
Revision: revision,
Revision: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the revision not used anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don't know when it's useful, but now this API cannot provide this field anymore.
cc @ystaticy do you know the purpose of this field?

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

/retest

1 similar comment
@MyonKeminta
Copy link
Contributor Author

/retest

storage := h.svr.GetStorage()
gcSafepoint, err := storage.LoadGCSafePoint()
gcStateManager := h.svr.GetGCStateManager()
gcState, err := gcStateManager.GetGCState(constant.NullKeyspaceID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have some way to get the Barriers for some keyspace using HTTP API? Or is it necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a long-term perspective, it's needed, but we haven't done it yet. It should also be integrated into the pd-ctl (see our design document).
Currently, the old service safe point API still works for compatibility, but only for non-keyspace deployment, and does not include gc_worker's service safe point.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 21, 2025

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

Details

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-sigs/prow repository.

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest LGTM

re.Equal("Failed to delete service GC safepoint: request pd http api failed with status: '500 Internal Server Error', body: '\"cannot remove service safe point of gc_worker\"'\n", string(output))
// This should be rejected previously, but as GC barrier became the replacement of services safe points and we no
// longer require the service safe point of "gc_worker", the deletion is now still allowed.
// re.Equal("Failed to delete service GC safepoint: request pd http api failed with status: '500 Internal Server Error', body: '\"cannot remove service safe point of gc_worker\"'\n", string(output))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just remove it?


// Service safepoint must have a non-empty ID
_, err = s.client.UpdateServiceGCSafePoint(context.Background(),
//nolint:staticcheck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are so many comments to disable the lint...

Copy link
Contributor Author

@MyonKeminta MyonKeminta Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lint complains about marking it deprecated while keeping it covered by tests 😰
How about wrap it in a closure so that the nolint directive can be limit in fewer places?

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 23, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 23, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, rleungx, tiancaiamao

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

The pull request process is described 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

1 similar comment
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, rleungx, tiancaiamao

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

The pull request process is described 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

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-23 08:07:17.809625651 +0000 UTC m=+151994.547051846: ☑️ agreed by rleungx.
  • 2025-07-23 09:37:16.648517529 +0000 UTC m=+157393.385943737: ☑️ agreed by JmPotato.

@MyonKeminta
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 0d31172 into tikv:master Jul 24, 2025
33 of 37 checks passed
@MyonKeminta MyonKeminta deleted the m/deprecate-old-gc-api branch July 24, 2025 10:23
okJiang pushed a commit to okJiang/pd that referenced this pull request Aug 7, 2025
… keyspace is configured (tikv#9468)

close tikv#8978

client: Remove public v2 client and redirect call to v2 internally if keyspace is configured

Removes the GC V2 related public APIs from PD client to avoid being used by new code. This is a temporary approach, and tikv#9292 will give a complete deprecation.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: okjiang <819421878@qq.com>
okJiang pushed a commit to okJiang/pd that referenced this pull request Aug 7, 2025
close tikv#8978

This PR migrates the old GC APIs to the new implementation, and marks them as deprecated.
Also suppresses warnings on necessary invocations to them, such as tests.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: okjiang <819421878@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor GC related PD APIs

4 participants