-
Notifications
You must be signed in to change notification settings - Fork 227
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
pick-6.5: Support adaptive update interval for low resolution ts (#1484) #1531
Conversation
Signed-off-by: MyonKeminta <[email protected]> Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
b3f755a
to
265712e
Compare
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.
Also pick #1502 in this PR?
I initially planned to cherry-pick these changes in separate PRs. After taking a look now, since it's only 11 lines, let's combine them into one. |
…nd there's too much logs about setting the config (tikv#1502) Signed-off-by: MyonKeminta <[email protected]>
@@ -47,19 +48,111 @@ import ( | |||
"github.com/tikv/client-go/v2/metrics" | |||
"github.com/tikv/client-go/v2/oracle" | |||
pd "github.com/tikv/pd/client" | |||
"go.uber.org/atomic" |
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.
Is there any reason to use the uber version rhe the original PR didn't? I think using the std one should be just fine🤔 Is this a mistake?
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.
std atomic was introduced in go 1.19, while release-6.5 uses go 1.18.
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.
😰
oracle/oracles/pd.go
Outdated
// pdOracle is an Oracle that uses a placement driver client as source. | ||
type pdOracle struct { | ||
c pd.Client | ||
// txn_scope (string) -> lastTSPointer (*lastTSOPointer) | ||
lastTSMap sync.Map | ||
quit chan struct{} | ||
// The configured interval to update the low resolution ts. Set by SetLowResolutionTimestampUpdateInterval. | ||
// For TiDB, this is directly controlled by the system variable `tidb_low_resolution_tso_update_interval`. |
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.
You can consider picking from other cherrypicks to old branches, in which I've modified some contents. e.g. #1491
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.
That makes sense. I've picked #1491 as the last commit.
…ikv#1491) Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: ekexium <[email protected]>
oracle/oracles/pd.go
Outdated
// Note that as `doUpdate` updates last tick time while `nextUpdateInterval` may perform calculation depending on the | ||
// last tick time, `doUpdate` should be called after finishing calculating the next interval. |
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.
Looks this is part of #1502 and don't need to be removed
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.
Ah yes
…nd there's too much logs about setting the config (tikv#1502) Signed-off-by: MyonKeminta <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MyonKeminta, you06 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 |
[LGTM Timeline notifier]Timeline:
|
Cherry pick #1484 and #1502 to tidb-6.5