-
Notifications
You must be signed in to change notification settings - Fork 188
dmctl: support and sync mutiple endpoints #1333
Conversation
I changed CI in #1331 (no time to address comment yet), maybe you could copy the deletion of others_integration to this PR |
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.
rest LGTM
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.
rest LGTM
I use reflect to send request so now can reuse the previous conn |
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
dm/ctl/common/util.go
Outdated
defer c.mu.Unlock() | ||
|
||
params := []reflect.Value{reflect.ValueOf(ctx), reflect.ValueOf(req)} | ||
results := reflect.ValueOf(ctlClient.masterClient).MethodByName(reqName).Call(params) |
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.
results := reflect.ValueOf(ctlClient.masterClient).MethodByName(reqName).Call(params) | |
results := reflect.ValueOf(c.masterClient).MethodByName(reqName).Call(params) |
OK to not change because we use a "global" CtlClient
dm/ctl/common/util.go
Outdated
} | ||
|
||
func (c *CtlClient) sendRequest(ctx context.Context, reqName string, req interface{}, respPointer interface{}) error { | ||
c.mu.Lock() |
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.
RLock
but OK to not change, because that's a not frequently used command
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
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-2.0 in PR #1349 |
What problem does this PR solve?
close #1278
What is changed and how it works?
sync etcd enpoints, dial dm-master before send request
Check List
Tests
connect dmctl to master clusters, kill one master, dmctl still can send request to others.