-
Notifications
You must be signed in to change notification settings - Fork 725
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
tso/local: remove local tso completely #8864
Conversation
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
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.
LGTM, but ci failed
@@ -217,17 +214,6 @@ func (am *AllocatorManager) getGroupIDStr() string { | |||
return strconv.FormatUint(uint64(am.kgID), 10) | |||
} | |||
|
|||
// GetTimestampPath returns the timestamp path in etcd. | |||
func (am *AllocatorManager) GetTimestampPath() string { |
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.
ditto
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.
GetTimestampPath
is only used to print log when created allocator manager
now. I think
log.Info("created allocator manager",
zap.Uint32("keyspace-group-id", group.ID))
is enough, do not have to know the TimestampPath.
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.
The comment is important and we also use it in the test.
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.
Did you say this comment?
// GetTimestampPath returns the timestamp path in etcd, which is:
// 1. for the default keyspace group:
// a. timestamp in /pd/{cluster_id}/timestamp
// b. lta/{dc-location}/timestamp in /pd/{cluster_id}/lta/{dc-location}/timestamp
// 1. for the non-default keyspace groups:
// a. {group}/gts/timestamp in /ms/{cluster_id}/tso/{group}/gta/timestamp
// b. {group}/lts/{dc-location}/timestamp in /ms/{cluster_id}/tso/{group}/lta/{dc-location}/timestamp
GetTimestampPath() string
It is outdated. lta/{dc-location}/timestamp in /pd/{cluster_id}/lta/{dc-location}/timestamp
and {group}/lts/{dc-location}/timestamp in /ms/{cluster_id}/tso/{group}/lta/{dc-location}/timestamp
are removed. We can see the left in
pd/pkg/utils/keypath/key_path.go
Lines 356 to 366 in 3cfd66f
// KeyspaceGroupGlobalTSPath constructs the timestampOracle path prefix for Global TSO, which is: | |
// 1. for the default keyspace group: | |
// "" in /pd/{cluster_id}/timestamp | |
// 2. for the non-default keyspace groups: | |
// {group}/gta in /ms/{cluster_id}/tso/{group}/gta/timestamp | |
func KeyspaceGroupGlobalTSPath(groupID uint32) string { | |
if groupID == constant.DefaultKeyspaceGroupID { | |
return "" | |
} | |
return path.Join(fmt.Sprintf("%05d", groupID), globalTSOAllocatorEtcdPrefix) | |
} |
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.
Got it. BTW, I found we still have some comments mentioning KeyspaceGroupLocalTSPath
, please also remove it.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8864 +/- ##
==========================================
+ Coverage 76.22% 76.23% +0.01%
==========================================
Files 461 461
Lines 70448 70395 -53
==========================================
- Hits 53696 53664 -32
+ Misses 13399 13383 -16
+ Partials 3353 3348 -5
Flags with carried forward coverage won't be shown. Click here to find out more. |
/retest |
client/client.go
Outdated
// Deprecated: Currently, regardless of the | ||
// parameters passed in, this method will default to returning the global TSO. |
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.
// Deprecated: Currently, regardless of the | |
// parameters passed in, this method will default to returning the global TSO. | |
// Deprecated: the Local TSO feature has been deprecated. Regardless of the parameters passed, the behavior of this interface will be equivalent to `GetTSAsync/GetTS`. If you want to use a separately deployed TSO service, please refer to the deployment of the TSO microservice. |
client/client.go
Outdated
@@ -582,7 +582,7 @@ func (c *client) GetTS(ctx context.Context) (physical int64, logical int64, err | |||
|
|||
// GetLocalTS implements the TSOClient interface. | |||
// | |||
// Deprecated: Local TSO will be completely removed in the future. Currently, regardless of the | |||
// Deprecated: Currently, regardless of the |
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.
Ditto.
Signed-off-by: okJiang <819421878@qq.com>
/retest |
Signed-off-by: okJiang <819421878@qq.com>
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato, niubell, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: Close #8802
What is changed and how does it work?
Check List
Tests
Release note