-
Notifications
You must be signed in to change notification settings - Fork 726
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
Changes from 2 commits
444b0db
14a8c86
eedb168
f8796e3
fe0f17b
dce1261
cf0d46a
182c18c
159c991
983b58a
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 |
---|---|---|
|
@@ -568,7 +568,7 @@ func (c *client) GetTSAsync(ctx context.Context) tso.TSFuture { | |
|
||
// GetLocalTSAsync implements the TSOClient interface. | ||
// | ||
// Deprecated: Local TSO will be completely removed in the future. Currently, regardless of the | ||
// Deprecated: Currently, regardless of the | ||
// parameters passed in, this method will default to returning the global TSO. | ||
func (c *client) GetLocalTSAsync(ctx context.Context, _ string) tso.TSFuture { | ||
return c.GetTSAsync(ctx) | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
// parameters passed in, this method will default to returning the global TSO. | ||
func (c *client) GetLocalTS(ctx context.Context, _ string) (physical int64, logical int64, err error) { | ||
return c.GetTS(ctx) | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,7 +17,6 @@ package tso | |||||||||||||||||||||||
import ( | ||||||||||||||||||||||||
"context" | ||||||||||||||||||||||||
"math" | ||||||||||||||||||||||||
"path" | ||||||||||||||||||||||||
"runtime/trace" | ||||||||||||||||||||||||
"strconv" | ||||||||||||||||||||||||
"sync" | ||||||||||||||||||||||||
|
@@ -43,8 +42,6 @@ const ( | |||||||||||||||||||||||
checkStep = time.Minute | ||||||||||||||||||||||||
patrolStep = time.Second | ||||||||||||||||||||||||
defaultAllocatorLeaderLease = 3 | ||||||||||||||||||||||||
localTSOAllocatorEtcdPrefix = "lta" | ||||||||||||||||||||||||
localTSOSuffixEtcdPrefix = "lts" | ||||||||||||||||||||||||
) | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
var ( | ||||||||||||||||||||||||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Did you say this comment?
It is outdated. pd/pkg/utils/keypath/key_path.go Lines 356 to 366 in 3cfd66f
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. Got it. BTW, I found we still have some comments mentioning |
||||||||||||||||||||||||
if am == nil { | ||||||||||||||||||||||||
return "" | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
am.mu.RLock() | ||||||||||||||||||||||||
defer am.mu.RUnlock() | ||||||||||||||||||||||||
return path.Join(am.rootPath, am.mu.allocatorGroup.allocator.GetTimestampPath()) | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
// tsoAllocatorLoop is used to run the TSO Allocator updating daemon. | ||||||||||||||||||||||||
func (am *AllocatorManager) tsoAllocatorLoop() { | ||||||||||||||||||||||||
defer logutil.LogPanic() | ||||||||||||||||||||||||
|
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.