[SERVER-19076] printShardingStatus/sh.status should pass a decent indent to tojson() for shard keys Created: 23/Jun/15 Updated: 12/Oct/17 Resolved: 21/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding, Shell |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.18, 3.4.10, 3.6.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin Pulo | Assignee: | Kevin Pulo |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Minor Change | ||||
| Backport Requested: |
v3.4, v3.2
|
||||
| Participants: | |||||
| Description |
|
When shard keys are long enough, they aren't output on a single line by sh.status(), e.g.:
This is because tojson() is used, rather than tojsononeline(). Outputting with tojsononeline() would make for very long lines, which would not be good, but as it stands the current output can be extremely difficult to read. The best solution would be to pass an appropriate indent value to tojson(), so that the indenting is preserved if multiple lines are needed. This would give output like:
|
| Comments |
| Comment by Githook User [ 04/Oct/17 ] |
|
Author: {'email': 'kevin.pulo@mongodb.com', 'name': 'Kevin Pulo', 'username': 'devkev'}Message: (cherry picked from commit a18d0f0c5754c750b44ba05ad7cc26b1f8054625) |
| Comment by Githook User [ 04/Oct/17 ] |
|
Author: {'email': 'kevin.pulo@mongodb.com', 'name': 'Kevin Pulo', 'username': 'devkev'}Message: (cherry picked from commit 18645e165e5f23e899b32cb5ebe45e9750dd3a97) Switch back to calling sh.isBalancerRunning() from printShardingStatus(), because it has the correct behaviour for this version. |
| Comment by Githook User [ 21/Sep/17 ] |
|
Author: {'email': 'kevin.pulo@mongodb.com', 'name': 'Kevin Pulo', 'username': 'devkev'}Message: |