-
Notifications
You must be signed in to change notification settings - Fork 355
PMM-11406 Better check to prevent errors from missing fields. #1013
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
base: 3.x
Are you sure you want to change the base?
Conversation
- Fixed log.Infof call on line 211
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.
Please add a test case.
I added a fix for the logrus.Infof error that broke tests for main. Now they are passed. I hope this is OK. |
@svetasmirnova Currently, we are not checking the output from the getHostInfo method at all. I’ve made a small change in the logic to make it more stable and robust for setup where getCmdLineOpts.recordStats or serverStatus.recordStats are missing. Right now, this situation ends with an error and produces no output at all. With this change, the missing fields will simply be skipped, and the rest of the output will still be printed. In the PMM team, our QA setup uses a sharded cluster with replica sets, but those two fields are always missing regardless of version or distribution. I can create a new test like this:
This would cover those cases, but since the Percona Toolkit test environment always has these fields, it won’t be able to test the missing-field scenario anyway. Thanks for fix of print. Also in scope of PR I removed unused method in main_test file. |
@JiriCtvrtka Yes, please add this test still. I have plans for improving the Percona Toolkit test environment btw. Not sure when find time for it. |
Test added. |
test fails with:
Is this expected? |
tbl => $orig_tbl, | ||
chunk_size => $o->get('chunk-size'), | ||
chunk_indx => $o->get('chunk-index'), | ||
chunk_index => $o->get('chunk-index'), |
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.
I think it does not work due to typo. Now it should be fixed.
@svetasmirnova Regarding failing TestClusterWideInfo/from_mongod – that should not be related to my changes in this PR. As for satisfying spelling/typos – I fixed them across the whole repository. One possible bug here because of this: https://github.com/percona/percona-toolkit/pull/1013/files#r2398484718 |
} | ||
} | ||
|
||
func addToCounters(ss proto.ServerStatus, increment int64) proto.ServerStatus { |
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.
Not used
Uh oh!
There was an error while loading. Please reload this page.