[SERVER-16375] Replication log message about vetoing can be truncated. Created: 01/Dec/14 Updated: 04/Dec/14 Resolved: 03/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 2.8.0-rc2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Spencer Brody (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Because BSONElement::toString() on a String-type element have a limit of 160 unless you explicitly tell it not to:
You can end up with log messages like this:
|
| Comments |
| Comment by Githook User [ 03/Dec/14 ] |
|
Author: {u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}Message: |
| Comment by Andy Schwerin [ 01/Dec/14 ] |
|
The problem here is that it's rarely appropriate to just serialize a BSONElement to a LogStreamBuilder or to a std::ostream, regardless of type and not by serializing its enclosing BSONObj. I recommend spot fixing this, by explicitly checking the "errmsg" field's type, and only logging if it's a known string. In that case, you can call msg.String() and send that to the log. |