cockroachdb / cockroachdb/cockroach

Deprecate the --log-format flag in merge-logs command

Open
#131,496 3 comments 0 reactions 0 assignees View on GitHub
branch-master C-bug T-supportability
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

The `--log-format` flag in the `debug merge-logs` and `debug zip upload` commands are confusing.

After digging into this further, it was found that:
- The debug zip always generates the logs in `crdb-v1` format. Take a look at [this part](https://github.com/cockroachdb/cockroach/blob/e8d2bde5d66317bc12a8d232ac68e471e2616aa8/pkg/cli/zip_per_node.go#L496-L498) of the code.
- `crdb-v1` is a legacy format now. `v21.1` onwards, `crdb-v2` is the main format ([ref](https://github.com/cockroachdb/cockroach/blob/c41d4a7e6669484597730d392f94c730f808cc1d/pkg/util/log/format_crdb_v2.go#L115)).
- Also, the conversion to `crdb-v1` is lossy as it has a limited set of fields compared to newer formats.
- [This PR comment](https://github.com/cockroachdb/cockroach/pull/66629#pullrequestreview-687584912) touches on the above point.
- This has something to do with the fact that the stderr logs are in a different custom format. the `crdb-v1` parser seems to be capable of handling the custom format. But not the other parsers?

**Expected behavior**

- Ideally, the format specified in the log files header should be used to determine the format to parse the logs in.
- Look into the parsing of stderr files in v1 and v2 and determining if v2 is missing some special casing to handle them.

**Slack**: https://cockroachlabs.slack.com/archives/C07KT4F00EA/p1727276143662199

Jira issue: CRDB-42573

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.