-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tool: fix up wal dump, add wal dump-merged #3864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @aadityasondhi)
0e918c8
to
3b1458a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up expanding this while debugging #3865 so that I could reproduce #3865 using the debug tool.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @aadityasondhi and @RaduBerinde)
3b1458a
to
221f62e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @aadityasondhi and @jbowens)
tool/wal.go
line 209 at r2 (raw file):
errf := func(offset wal.Offset, format string, args ...interface{}) { prefix := fmt.Sprintf("%s: error: ", offset) fmt.Fprintf(stderr, prefix+format+"\n", args...)
This kind of non-constant format string can trip up newer versions of lint checks (see cockroachdb/cockroach#129208).
I'd just pass an error
and use errors.Wrap
at the callsite and here to add info.
tool/wal.go
line 289 at r2 (raw file):
s, err := rangekey.Decode(ik, value, nil) if err != nil { errf("%s: error decoding %s", w.fmtKey.fn(ukey), err)
[nit] errf
prints to stdout
with a newline, unlike the other cases here. Maybe keep the fmt.Fprintf(stdout
here and remove it from errf
.
If it's not hard, it would be nice to have this case show up in the test.
Adjust the wal dump tool to error on unrecognized key kinds, and surface errors encounted more prominently in the output. Additionally, add a new `wal dump-merged` command that dumps the merged view of a WAL that's composed of multiple physical segment files.
221f62e
to
124c485
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @aadityasondhi and @RaduBerinde)
tool/wal.go
line 209 at r2 (raw file):
Previously, RaduBerinde wrote…
This kind of non-constant format string can trip up newer versions of lint checks (see cockroachdb/cockroach#129208).
I'd just pass an
error
and useerrors.Wrap
at the callsite and here to add info.
Done
tool/wal.go
line 289 at r2 (raw file):
Previously, RaduBerinde wrote…
[nit]
errf
prints tostdout
with a newline, unlike the other cases here. Maybe keep thefmt.Fprintf(stdout
here and remove it fromerrf
.If it's not hard, it would be nice to have this case show up in the test.
Done
I gave the test case a stab but aborted for now because it is tricky
Adjust the wal dump tool to error on unrecognized key kinds, and surface errors
encounted more prominently in the output.
Additionally, add a new
wal dump-merged
command that dumps the merged view ofa WAL that's composed of multiple physical segment files.
Informs #3865.