-
Notifications
You must be signed in to change notification settings - Fork 728
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
ctl: replace gc_safepoint call with PD HTTP SDK #8502
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -100,6 +100,8 @@ type Client interface { | |||||||
/* Other interfaces */ | ||||||||
GetMinResolvedTSByStoresIDs(context.Context, []uint64) (uint64, map[uint64]uint64, error) | ||||||||
GetPDVersion(context.Context) (string, error) | ||||||||
GetGCSafePoint(context.Context) (ListServiceGCSafepoint, error) | ||||||||
DeleteGCSafePoint(context.Context, string) (string, error) | ||||||||
/* Micro Service interfaces */ | ||||||||
GetMicroServiceMembers(context.Context, string) ([]MicroServiceMember, error) | ||||||||
GetMicroServicePrimary(context.Context, string) (string, error) | ||||||||
|
@@ -1024,3 +1026,29 @@ func (c *client) GetKeyspaceMetaByName(ctx context.Context, keyspaceName string) | |||||||
} | ||||||||
return &keyspaceMetaPB, nil | ||||||||
} | ||||||||
|
||||||||
func (c *client) GetGCSafePoint(ctx context.Context) (ListServiceGCSafepoint, error) { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each exported function should contain a line of comments.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do! |
||||||||
var gcsafepoint ListServiceGCSafepoint | ||||||||
err := c.request(ctx, newRequestInfo(). | ||||||||
WithName(GetGCSafePointName). | ||||||||
WithURI(safepoint). | ||||||||
WithMethod(http.MethodGet). | ||||||||
WithResp(&gcsafepoint)) | ||||||||
if err != nil { | ||||||||
return gcsafepoint, err | ||||||||
} | ||||||||
return gcsafepoint, nil | ||||||||
} | ||||||||
|
||||||||
func (c *client) DeleteGCSafePoint(ctx context.Context, service_id string) (string, error) { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||||||||
var msg string | ||||||||
err := c.request(ctx, newRequestInfo(). | ||||||||
WithName(DeleteGCSafePointName). | ||||||||
WithURI(safepoint+"/"+service_id). | ||||||||
WithMethod(http.MethodDelete). | ||||||||
WithResp(&msg)) | ||||||||
if err != nil { | ||||||||
return msg, err | ||||||||
} | ||||||||
return msg, nil | ||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,8 @@ require ( | |
github.com/aws/smithy-go v1.13.5 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/bitly/go-simplejson v0.5.0 // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
// github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.5-0.20211112114546-24b7fddb24dc // indirect | ||
Comment on lines
+85
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually, an indirect dependency should not be modified manually. Why change it? |
||
github.com/bytedance/sonic v1.9.1 // indirect | ||
github.com/cenkalti/backoff/v4 v4.0.2 // indirect | ||
github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,8 @@ require ( | |
github.com/aws/smithy-go v1.13.5 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/bitly/go-simplejson v0.5.0 // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
// github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.5-0.20211112114546-24b7fddb24dc // indirect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
github.com/bytedance/sonic v1.9.1 // indirect | ||
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 // indirect | ||
github.com/cenkalti/backoff/v4 v4.0.2 // indirect | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,8 @@ require ( | |
github.com/aws/smithy-go v1.13.5 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/bitly/go-simplejson v0.5.0 // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
// github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch // indirect | ||
github.com/breeswish/gin-jwt/v2 v2.6.5-0.20211112114546-24b7fddb24dc // indirect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
github.com/bytedance/sonic v1.9.1 // indirect | ||
github.com/cenkalti/backoff/v4 v4.0.2 // indirect | ||
github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is best not to introduce unrelated changes in a PR with a clear purpose. You can open another PR to make these modifications. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, those files were added because I merged changes from upstream/master while working in the dev branch. Will pay attention in the future! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like you don't merge the upstream changes correctly, which makes them become part of "your" changes. It is recommended to do this by rebasing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align with other definitions: