-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
infoschema: add tidb_servers_info memory table #12580
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12580 +/- ##
==========================================
Coverage ? 80.178%
==========================================
Files ? 462
Lines ? 107048
Branches ? 0
==========================================
Hits ? 85829
Misses ? 15094
Partials ? 6125 |
/run-all-tests |
domain/infosync/info.go
Outdated
func (is *InfoSyncer) GetAllServerInfo(ctx context.Context) (map[string]*ServerInfo, error) { | ||
func GetAllServerInfo(ctx context.Context) (map[string]*ServerInfo, error) { | ||
if globalInfoSyncer == nil { | ||
return nil, nil |
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.
If globalInfoSyncer
is nil, err shouldn't be nil. Otherwise it would panic when executing serverInfo.IP
.
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.
Great.
Co-Authored-By: Arenatlx <[email protected]>
Co-Authored-By: Arenatlx <[email protected]>
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
@@ -299,8 +300,7 @@ func (s *testSuiteP1) TestAdmin(c *C) { | |||
// rowOwnerInfos := strings.Split(row.Data[1].GetString(), ",") | |||
// ownerInfos := strings.Split(ddlInfo.Owner.String(), ",") | |||
// c.Assert(rowOwnerInfos[0], Equals, ownerInfos[0]) | |||
do := domain.GetDomain(tk.Se.(sessionctx.Context)) | |||
serverInfo, err := do.InfoSyncer().GetServerInfoByID(ctx, row.GetString(1)) | |||
serverInfo, err := infosync.GetServerInfoByID(ctx, row.GetString(1)) |
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.
Cause server info can access in a manner of table, we need other tests for testing SQL on your memory table to prevent code coverage decrease.
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.
see TestForServersInfo
.
LGTM |
/run-all-tests |
Signed-off-by: crazycs <[email protected]>
What problem does this PR solve?
What is changed and how it works?
Check List
Tests
Code changes