Skip to content

crl-release-25.4: pebble: log per-table/blob output sizes for flushes and compactions#6119

Merged
RaduBerinde merged 1 commit into
cockroachdb:crl-release-25.4from
RaduBerinde:pebble-log-per-table-blob-output-sizes-for-flushes-25.4
Jul 3, 2026
Merged

crl-release-25.4: pebble: log per-table/blob output sizes for flushes and compactions#6119
RaduBerinde merged 1 commit into
cockroachdb:crl-release-25.4from
RaduBerinde:pebble-log-per-table-blob-output-sizes-for-flushes-25.4

Conversation

@RaduBerinde

Copy link
Copy Markdown
Member

Flush and compaction event log lines previously printed the output sstable
file numbers and a single aggregate size, e.g. -> L6 [000123 000124] (3.0MB). Compaction lines did not print output blob files at all, even
though CompactionInfo.Output.Blobs was already populated.

This change prints size details for each output table and each output blob
file, which is cheap information that helps with debugging. Three helpers are
added in event.go:

  • FormatTablesWithSizes renders each table as filenum(size+refsize),
    omitting +refsize when the blob reference size is zero.
  • FormatBlobsWithSizes renders each blob file as filenum(size), plus the
    MVCC garbage percentage when present.
  • formatOutputBlobs builds the shared blob(s) [...] (...) segment used by
    both the flush and compaction log lines.

Both FlushInfo.SafeFormat and CompactionInfo.SafeFormat now use these
helpers; the aggregate total is also shown as size+refsize, and compaction
lines now include the output blob segment.

The tool/logs compaction/flush log parser extracts the aggregate output
size from these lines. Its regexes are updated to anchor the byte capture on
the closing ] of the file list, so they skip the per-file sizes now
embedded in the list (and the trailing blob segment), and to accept +
without surrounding spaces. Both the compaction and flush end-line parsers
now use unHumanizeSum to handle the table + blob sum. This is backward
compatible with older log formats; new tests cover the new format and the
match-to-parse path.

Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com

@RaduBerinde RaduBerinde requested a review from fqazi July 1, 2026 02:22
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 1, 2026 02:22
@cockroach-teamcity

Copy link
Copy Markdown
Member

This change is Reviewable

@fqazi

fqazi commented Jul 1, 2026

Copy link
Copy Markdown

Linter isn't happy because formatting

})
}
}
// TestParseEndWrittenBytes exercises the full match -> parse path for compaction

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a new line here

Flush and compaction event log lines previously printed the output sstable
file numbers and a single aggregate size, e.g. `-> L6 [000123 000124]
(3.0MB)`. Compaction lines did not print output blob files at all, even
though `CompactionInfo.Output.Blobs` was already populated.

This change prints size details for each output table and each output blob
file, which is cheap information that helps with debugging. Three helpers are
added in `event.go`:

- `FormatTablesWithSizes` renders each table as `filenum(size+refsize)`,
  omitting `+refsize` when the blob reference size is zero.
- `FormatBlobsWithSizes` renders each blob file as `filenum(size)`, plus the
  MVCC garbage percentage when present.
- `formatOutputBlobs` builds the shared ` blob(s) [...] (...)` segment used by
  both the flush and compaction log lines.

Both `FlushInfo.SafeFormat` and `CompactionInfo.SafeFormat` now use these
helpers; the aggregate total is also shown as `size+refsize`, and compaction
lines now include the output blob segment.

The `tool/logs` compaction/flush log parser extracts the aggregate output
size from these lines. Its regexes are updated to anchor the byte capture on
the closing `]` of the file list, so they skip the per-file sizes now
embedded in the list (and the trailing blob segment), and to accept `+`
without surrounding spaces. Both the compaction and flush end-line parsers
now use `unHumanizeSum` to handle the `table + blob` sum. This is backward
compatible with older log formats; new tests cover the new format and the
match-to-parse path.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@RaduBerinde RaduBerinde force-pushed the pebble-log-per-table-blob-output-sizes-for-flushes-25.4 branch from 65e93f6 to b5162a6 Compare July 3, 2026 02:18
@RaduBerinde RaduBerinde merged commit 7a5715d into cockroachdb:crl-release-25.4 Jul 3, 2026
8 checks passed
@RaduBerinde RaduBerinde deleted the pebble-log-per-table-blob-output-sizes-for-flushes-25.4 branch July 3, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants