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

server, endpoint, client: Add PD APIs for RawKV GC Worker #4866

Closed
wants to merge 21 commits into from

Conversation

AmoebaProtozoa
Copy link
Contributor

@AmoebaProtozoa AmoebaProtozoa commented Apr 27, 2022

What problem does this PR solve?

Issue Number: ref #4865
RFC: tikv/rfcs#90

What is changed and how does it work?

Added Support for RawKV GC APIs

For more information, please read https://github.com/tikv/rfcs/pull/90

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Related changes

ToDo:

  • Update go mod reference after kvproto has been merged
  • Unit test & debug
  • Manual test along with new RawKV GC worker & RawKV CDC tools

Release note

None.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed labels Apr 27, 2022
@ti-chi-bot ti-chi-bot added release-note-none needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/release-note-label-needed labels Apr 27, 2022
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 5, 2022
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
@AmoebaProtozoa AmoebaProtozoa marked this pull request as ready for review May 6, 2022 07:48
@AmoebaProtozoa AmoebaProtozoa changed the title [WIP] server, endpoint, client: Add PD APIs for RawKV GC Worker server, endpoint, client: Add PD APIs for RawKV GC Worker May 6, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 6, 2022
@@ -178,11 +194,149 @@ func (se *StorageEndpoint) SaveServiceGCSafePoint(ssp *ServiceSafePoint) error {
return se.Save(key, string(value))
}

// RemoveServiceGCSafePoint removes a GC safepoint for the service
// RemoveServiceGCSafePoint removes a GC safeoint for the service

Choose a reason for hiding this comment

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

typo

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
// gcSafePointPathByServiceGroup returns the path of the gc_worker's safe point
// /gc_servicegroup/gc_safepoint/$service_group_id
func gcSafePointPathByServiceGroup(serviceGroupID string) string {
return path.Join(gcServiceGroupPath, "gc_safepoint", serviceGroupID)

Choose a reason for hiding this comment

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

suggest to define the path including gc_safepoint service_safepoint as const.

…_path.go

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
client/client.go Outdated
c.ScheduleCheckLeader()
return false, 0, errors.WithStack(err)
}
// if requested safepoint is the new safepoint, then update succeeded
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// if requested safepoint is the new safepoint, then update succeeded
// If requested safepoint is the new safepoint, then update succeeded

pingyu and others added 4 commits May 9, 2022 23:15
Signed-off-by: pingyu <yuping@pingcap.com>
Signed-off-by: pingyu <yuping@pingcap.com>
Signed-off-by: pingyu <yuping@pingcap.com>
Copy link

@haojinming haojinming left a comment

Choose a reason for hiding this comment

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

LGTM~

@ti-chi-bot
Copy link
Member

@haojinming: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

LGTM~

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 ti-community-infra/tichi repository.

Signed-off-by: pingyu <yuping@pingcap.com>
@pingyu
Copy link
Contributor

pingyu commented May 10, 2022

/cc @nolouch @MyonKeminta

@ti-chi-bot ti-chi-bot requested a review from nolouch May 10, 2022 08:36
@ti-chi-bot
Copy link
Member

@pingyu: GitHub didn't allow me to request PR reviews from the following users: MyonKeminta.

Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @nolouch @MyonKeminta

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.

@pingyu
Copy link
Contributor

pingyu commented May 10, 2022

/cc @nolouch @MyonKeminta

PTAL, thanks~

@nolouch
Copy link
Contributor

nolouch commented May 10, 2022

PTAL @AndreMouche

@nolouch nolouch requested review from AndreMouche and removed request for lhy1024 May 10, 2022 09:12
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

Can you split your PR to small parts to help review?

@@ -130,6 +131,22 @@ type Client interface {
UpdateOption(option DynamicOption, value interface{}) error
// Close closes the client.
Close()

// GetGCAllServiceGroups returns a list containing all service groups that has safe point in pd
GetGCAllServiceGroups(ctx context.Context) ([]string, error)
Copy link
Contributor

@nolouch nolouch May 10, 2022

Choose a reason for hiding this comment

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

Better to define independently and then nested in here;

@pingyu
Copy link
Contributor

pingyu commented May 10, 2022

Can you split your PR to small parts to help review?

OK~

@pingyu
Copy link
Contributor

pingyu commented May 11, 2022

Can you split your PR to small parts to help review?

Here is the storage part. PTAL, thanks~

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2022
@ti-chi-bot
Copy link
Member

@AmoebaProtozoa: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants