PT-2354: pt-mongodb-summary graceful ARBITER handling#1144
Open
eslavyansky wants to merge 2 commits into
Open
Conversation
Running pt-mongodb-summary directly against a replica-set arbiter crashed the report: hostInfo is denied on an arbiter, and main treated any hostInfo failure as fatal (os.Exit). Connecting to a data-bearing member also left the arbiter as a blank row in the Instances list. Detect arbiters via isMaster (arbiterOnly, with me-in-arbiters fallback) and: - build a best-effort host summary from non-privileged fields instead of exiting, with a note explaining arbiter limitations; - render the arbiter as ARBITER in the Instances list, with ReplSet filled; - guard the mongos, runningOps and security report sections against nil so the formatter no longer panics when those collectors are unauthorized.
newArbiterHostInfo seeds ReplicasetName from isMaster's setName, but the serverStatus block unconditionally overwrote it with ss.Repl.SetName, which can be empty on an arbiter. Only override when non-empty so the seeded value survives.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PT-2354
Running
pt-mongodb-summarydirectly against a replica-set arbiter crashed the report:hostInfois denied on an arbiter, andmaintreated anyhostInfofailure as fatal (os.Exit). Connecting to a data-bearing member also left the arbiter as a blank row in the Instances list.