-
Notifications
You must be signed in to change notification settings - Fork 711
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
pdms: support primary/transfer api for scheduling and tso #8157
base: master
Are you sure you want to change the base?
Conversation
[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 The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: husharp <jinhao.hu@pingcap.com>
510f18d
to
7fa19d3
Compare
480b075
to
2a647ac
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
2a647ac
to
1f13fa2
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
5490d10
to
02a8c4a
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
02a8c4a
to
8d36be5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8157 +/- ##
==========================================
+ Coverage 77.34% 77.36% +0.01%
==========================================
Files 471 471
Lines 61368 61588 +220
==========================================
+ Hits 47466 47647 +181
- Misses 10341 10367 +26
- Partials 3561 3574 +13
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
1fe976d
to
dd72b9c
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
"--listen-addr=" + c.ListenAddr, | ||
"--advertise-listen-addr=" + c.AdvertiseListenAddr, | ||
"--backend-endpoints=" + c.BackendEndpoints, | ||
} | ||
|
||
flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) | ||
flagSet.StringP("name", "", "", "human-readable name for this scheduling member") |
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.
Shall we need a default name?
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.
default name set by this code, which is like TSO-localhost
pd/pkg/mcs/tso/server/config.go
Lines 185 to 195 in a39300e
func (c *Config) Adjust(meta *toml.MetaData) error { | |
configMetaData := configutil.NewConfigMetadata(meta) | |
if err := configMetaData.CheckUndecoded(); err != nil { | |
c.WarningMsgs = append(c.WarningMsgs, err.Error()) | |
} | |
if c.Name == "" { | |
hostname, err := os.Hostname() | |
if err != nil { | |
return err | |
} | |
configutil.AdjustString(&c.Name, fmt.Sprintf("%s-%s", defaultName, hostname)) |
And your commented snippet is for testing to avoid using the same name for the same machine for local testing, I used addr here
Lines 87 to 88 in 51708b5
cfg.Name = cfg.ListenAddr | |
cfg, err := tso.GenerateConfig(cfg) |
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
pkg/election/leadership.go
Outdated
@@ -64,6 +64,8 @@ type Leadership struct { | |||
leaderKey string | |||
leaderValue string | |||
|
|||
leaderWatch atomic.Bool |
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.
Will it only be used in ms?
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.
For now, yes.
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@@ -415,5 +415,5 @@ func (ls *Leadership) Reset() { | |||
} | |||
ls.keepAliveCancelFuncLock.Unlock() | |||
ls.getLease().Close() | |||
ls.SetLeaderWatch(false) | |||
ls.SetPrimaryWatch(false) |
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.
Do we need to skip it in non-ms mode?
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.
Maybe it's no problem that this code makes false negatives for non-ms mode
.
Signed-off-by: husharp <jinhao.hu@pingcap.com>
63a61e9
to
a4c5c29
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
What problem does this PR solve?
Issue Number: Ref #5766, #7519
What is changed and how does it work?
the members info are
curl --location --request GET 'http://127.0.0.1:2379/pd/api/v2/ms/members/tso'
get
Check List
Tests
Release note