-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
cli: add "debug zip" command #14033
cli: add "debug zip" command #14033
Conversation
I thought there was an issue open for this, but I can't find it right now. |
1626601
to
dc32bdc
Compare
package cli | ||
|
||
import ( | ||
"archive/zip" |
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.
tar seems more fitting, no? is the reason you're picking zip the compressed-by-default?
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.
No strong reason. Tar would require compression. Nice that zip gives that out of the box.
z := newZipper(out) | ||
defer z.close() | ||
|
||
if events, err := admin.Events(ctx, &serverpb.EventsRequest{}); err != nil { |
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.
maybe add some logging about attempt/success/failure of each item?
eg:
events: OK
liveness: FAIL (error: blah blah)
this would be clearer than failures being logged silently to the corresponding file. We could include that summary in the zip too.
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.
Errors are logged to the screen. See createError
which writes the error both to the archive and to stdout.
Well, the errors do get logger now, though it's a bit scattered
Reviewed 3 of 3 files at r1. pkg/cli/zip.go, line 28 at r1 (raw file):
separate group for this pkg/cli/zip.go, line 66 at r1 (raw file):
did you mean to leave this? pkg/cli/zip.go, line 88 at r1 (raw file):
ditto pkg/cli/zip.go, line 93 at r1 (raw file):
ditto pkg/cli/zip.go, line 107 at r1 (raw file):
this will be confusing if more than one argument is specified. pkg/cli/zip.go, line 153 at r1 (raw file):
use the pkg/cli/zip.go, line 182 at r1 (raw file):
ditto pkg/cli/zip.go, line 210 at r1 (raw file):
ditto pkg/cli/zip.go, line 230 at r1 (raw file):
ditto Comments from Reviewable |
dc32bdc
to
f2fa9e3
Compare
Review status: 2 of 3 files reviewed at latest revision, 9 unresolved discussions. pkg/cli/zip.go, line 28 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done, though pkg/cli/zip.go, line 66 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Yes. This shows progress during creation of the zip. pkg/cli/zip.go, line 88 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Yes. pkg/cli/zip.go, line 93 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Yes, this includes the error in the zip file so we'll be able to see if there was a problem retrieving some piece of data. pkg/cli/zip.go, line 107 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Do you have a suggestion? This was cribbed from pkg/cli/zip.go, line 153 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. pkg/cli/zip.go, line 182 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. pkg/cli/zip.go, line 210 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. pkg/cli/zip.go, line 230 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. Comments from Reviewable |
Reviewed 1 of 1 files at r2. pkg/cli/zip.go, line 28 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
There's pretty consistent pattern of putting cockroachdb imports at the bottom, but OK. Sadly this change you made is the opposite of the convention. pkg/cli/zip.go, line 93 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Ack. Error() is superfluous. pkg/cli/zip.go, line 107 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Sure. "exactly one argument is required". Comments from Reviewable |
f2fa9e3
to
f4ea235
Compare
Review status: 2 of 3 files reviewed at latest revision, 3 unresolved discussions. pkg/cli/zip.go, line 28 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Switched. I'm curious how often you look at the imports. I almost never do. The ordering seems unimportant. pkg/cli/zip.go, line 93 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. pkg/cli/zip.go, line 107 at r1 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Done. Comments from Reviewable |
Reviewed 1 of 1 files at r3. Comments from Reviewable |
f4ea235
to
c66438b
Compare
Add "debug zip" command which gathers cluster debug data into a zip file. Data includes cluster events, node liveness, node status, range status, node stack traces, log files and SQL schema. Fixes cockroachdb#12681
c66438b
to
de37eff
Compare
Neat. |
Add "debug zip" command which gathers cluster debug data into a zip
file. Data includes cluster events, node liveness, node status, range
status, node stack traces, log files and SQL schema.
This change is