-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
64128: cli/zip: clamp file retrieval by date, default to last 48 hours r=tbg,stevendanna a=knz All commits but the last from #64094 and prior. Fixes #57795 The size of generated `debug zip` outputs is mostly attributable to the discrete files retrieved from the server: - log files - goroutine dumps - heap profiles Even though we have various garbage collection techniques applied to these files, they still yield very large `debug zip` outputs: - the default retained cap for log files is 100MB per group, so with the default of up to 5 log groups per node, we are retaining up to 500MB of log files per node. - the default retained cap for goroutine dumps, heap profiles and memory stats is 128MB for each, so we are retaining up to 384MB of these files per node. For example, for a 10-node cluster we are looking at up to 7GB of data retained in these files in the default configuration. While this amount of data is relatively innocuous while it remains in the data directories server-side, the `debug zip` behavior which was previously to retrieve *all* of it was detrimental to the process of troubleshooting anomalies: this is a lot of data to move around, it cannot be e-mailed effectively, etc. In comparison, the other items retrieved by the `debug zip` command (range descriptors, SQL system tables) are typically just kilobytes large. Even a large cluster with tens of thousands of ranges and system tables typically incurs `zip` payloads no greater than a dozen megabytes. Hence the change described in the release note below. Release note (cli change): The `cockroach debug zip` command now retrieves only the log files, goroutine dumps and heap profiles pertaining to the last 48 hours prior to the command invocation. This behavior is supported entirely client-side, i.e. it is not necessary to upgrade the server nodes to effect these newly configurable limits. This behavior can be customized by the two new flags `--files-from` and `--files-until`. Both are optional. See the command-line help text for details. The other data items retrieved by `debug zip` are not affected by this time limit. The two new flags are also supported by `cockroach debug list-files`. It is advised to experiment with `list-files` prior to issuing a `debug zip` command that may retrieve a large amount of data. 64211: lint: check `make bazel-generate` earlier in the `teamcity-check` script r=rail a=rickystewart We used to do this after `make buildshort` and `make generate`, but those can take a while. Do it before so obvious Bazel linter errors break the build sooner. Release note: None Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
- Loading branch information
Showing
17 changed files
with
643 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#! /usr/bin/env expect -f | ||
|
||
source [file join [file dirname $argv0] common.tcl] | ||
|
||
spawn /bin/bash | ||
send "PS1=':''/# '\r" | ||
eexpect ":/# " | ||
|
||
start_server $argv | ||
|
||
# A server start populates a log directory with multiple files. We expect | ||
# at least cockroach-stderr.*, cockroach.* and cockroach-pebble.*. | ||
|
||
start_test "Check that --include-files excludes files that do not match the pattern" | ||
send "$argv debug zip --cpu-profile-duration=0 --include-files='cockroach.*' /dev/null\r" | ||
|
||
eexpect "log files found" | ||
eexpect "skipping excluded log file: cockroach-stderr." | ||
eexpect "skipping excluded log file: cockroach-pebble." | ||
eexpect "\[log file: cockroach." | ||
eexpect ":/# " | ||
end_test | ||
|
||
start_test "Check that --excludes-files excludes files that match the pattern" | ||
send "$argv debug zip --cpu-profile-duration=0 --exclude-files='cockroach.*' /dev/null\r" | ||
|
||
eexpect "log files found" | ||
eexpect "\[log file: cockroach-stderr." | ||
eexpect "\[log file: cockroach-pebble." | ||
eexpect "skipping excluded log file: cockroach." | ||
eexpect ":/# " | ||
end_test | ||
|
||
|
||
stop_server $argv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.