Skip to content

PT-2354: pt-mongodb-summary graceful ARBITER handling#1144

Open
eslavyansky wants to merge 2 commits into
percona:3.xfrom
eslavyansky:PT-2354-pt-mongodb-summary-arbiter
Open

PT-2354: pt-mongodb-summary graceful ARBITER handling#1144
eslavyansky wants to merge 2 commits into
percona:3.xfrom
eslavyansky:PT-2354-pt-mongodb-summary-arbiter

Conversation

@eslavyansky

@eslavyansky eslavyansky commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

PT-2354

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.

  • The contributed code is licensed under GPL v2.0
  • Contributor Licence Agreement (CLA) is signed
  • util/update-modules has been ran
  • Documentation updated
  • Test suite update

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant