roachpb: Key.Format implementation doesn't properly escape non-UTF8 characters
See https://github.com/cockroachdb/cockroach/pull/9067. I'm not sure what the right behaviour is here - if the caller asks for %s, does that mean we need to emit UTF8?
cc @petermattis
Do you have an example of a key we misbehave on?
No example, but it's going to happen whenever a non-UTF8 sequence leaks into the output of Format, which is whenever the raw key contains non-UTF8 sequences which are not recognized by the pretty-printer.
@tamird I'd like to work on this and fix this. It'd be great if you can help me out by letting me know what the expected behavior should be in case the raw key consists of non-UTF8 sequences. Also, this would be my first bug, so apologies if I've any mistakes :)
In case the key consists of non-UTF8 sequences, those sequences should be printed as hex, e.g. "\xff".
Let me know if you have more questions, and thanks for tackling this!
want to try this if no one is working.
Sure, you can work on this one. I've been busy lately and therefore have been unable to send in a pull request.
On Fri, Nov 18, 2016, 12:57 kiran [email protected] wrote:
want to try this if no one is working.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cockroachdb/cockroach/issues/9391#issuecomment-261639806, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqgWmUOb3B51yft4QCSX_x1DRYLXEIAks5q_hEngaJpZM4J9-3i .
Here's an (ephemeral, until TC GCs the log) example: https://teamcity.cockroachdb.com/viewLog.html?buildId=379771&buildTypeId=Cockroach_UnitTests_Testlogicrace&tab=buildLog&_focus=2113
[20:40:02]E171017 00:39:47.336078 514465 storage/consistency_queue.go:107 [replica consistency checker,n1,s1,r1/1:/{Min-System/}] key range /Min-/Max outside of bounds of range /Min-/System/""
[20:40:02]E171017 00:39:54.785179 516093 storage/queue.go:656 [replicate,n4,s4,r12/4:/Table/1{5-6}] no removable replicas from range that needs a removal: [1:0, 2:0, 3:0, 4*:33]
[20:40:02]E171017 00:39:57.446972 516096 storage/queue.go:656 [raftsnapshot,n4,s4,r33/2:/System/ts{d/cr.no���-e}] [n4,s4,r33/2:/System/ts{d/cr.no���-e}]: failed to generate Raft snapshot: [n4,s4,r33/2:/System/ts{d/cr.no���-e}]: not generating Raft snapshot because replica is too large: 90310 > 2 * 32768
[20:40:02]E171017 00:39:57.510512 514461 storage/queue.go:656 [replicate,n1,s1,r20/1:/System/{StatusNo���-tsd}] raft status not initialized
[20:40:02]E171017 00:39:58.192608 516096 storage/queue.go:656 [raftsnapshot,n4,s4,r33/2:/System/ts{d/cr.no���-e}] [n4,s4,r33/2:/System/ts{d/cr.no���-e}]: failed to generate Raft snapshot: [n4,s4,r33/2:/System/ts{d/cr.no���-e}]: not generating Raft snapshot because replica is too large: 90310 > 2 * 32768
[20:40:02]E171017 00:39:58.747433 516096 storage/queue.go:656 [raftsnapshot,n4,s4,r34/2:/System/ts{d/cr.no���-e}] [n4,s4,r34/2:/System/ts{d/cr.no���-e}]: failed to generate Raft snapshot: [n4,s4,r34/2:/System/ts{d/cr.no���-e}]: not generating Raft snapshot because replica is too large: 73911 > 2 * 32768
[20:40:02]E171017 00:39:59.716945 516096 storage/queue.go:656 [raftsnapshot,n4,s4,r35/2:/System/ts{d/cr.no���-e}] snapshot failed: (n1,s1):1: remote couldn't accept snapshot with error: [n1,s1],r35: cannot apply snapshot: snapshot intersects existing range [n1,s1,r33/1:/System/ts{d/cr.no���-e}]
[20:40:02]E171017 00:39:59.739596 516096 storage/queue.go:656 [raftsnapshot,n4,s4,r34/2:/System/tsd/cr.node.sql.mem.���] snapshot failed: (n1,s1):1: remote couldn't accept snapshot with error: [n1,s1],r34: cannot apply snapshot: snapshot intersects existing range [n1,s1,r33/1:/System/ts{d/cr.no���-e}]
[20:40:02]E171017 00:40:01.227933 516093 storage/queue.go:656 [replicate,n4,s4,r37/2:/System/ts{d/cr.no���-e}] no removable replicas from range that needs a removal:
[20:40:02]E171017 00:40:02.024549 516469 storage/queue.go:656 [replicate,n5,s5,r19/2:/System/StatusNode/{3-4}] change replicas of r19 failed: failed to send RPC: sending to all 3 replicas failed; last error: {<nil> rpc error: code = FailedPrecondition desc = grpc: the client connection is closing}
@tamird I'd love to work on this issue. Pls assign it to me :)
@ruzaikr, you can feel free to send PRs if you want to try to fix things. We normally don't assign issues to external contributors.
@jordanlewis I think we can close this issue as PR #56242 has been merged.
Thanks for your contribution @neeral