[SERVER-35617] Unpleasant db.enableFreeMonitoring "not master" error on newly launched mongod Created: 15/Jun/18 Updated: 29/Oct/23 Resolved: 01/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 4.0.0-rc5 |
| Fix Version/s: | 4.0.2, 4.1.2 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Jeremy Mikola | Assignee: | Mark Benvenuto |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v4.0
|
||||
| Sprint: | Platforms 2018-08-13 | ||||
| Participants: | |||||
| Description |
|
I launched a new mongod process with an empty database directory:
Upon accessing the mongod with the shell, I saw a blurb inviting me to run db.enableFreeMonitoring(). I happened to run this before rs.initiate() and was greeted with the following, unpleasant error:
It may be trivial to improve the user experience here by having db.enableFreeMonitoring check that the active connection is a primary before attempting to run the setFreeMonitoring command. |
| Comments |
| Comment by Githook User [ 07/Aug/18 ] | ||
|
Author: {'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}Message: (cherry picked from commit 30298ed63aadae19bd5494dd0e1f33e329389806) | ||
| Comment by Githook User [ 01/Aug/18 ] | ||
|
Author: {'username': 'markbenvenuto', 'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com'}Message: | ||
| Comment by Mark Benvenuto [ 24/Jul/18 ] | ||
|
jmikola and matt.lord, to improve the user experience when a user either connects to a secondary replica or uninitiated replica set, I can print a message like:
I would like to continue to display the banner without checking replica set status since they may initialize the replica during a given shell session. I am open to suggestions. | ||
| Comment by Mark Benvenuto [ 15/Jun/18 ] | ||
|
We can improve the user experience when in a replica set to check if the replica set has been initialized to give the user guidance about the next steps to take. |