Commit Graph
2 Commits
Author SHA1 Message Date
murphy-4oandClaude Opus 4.8 8a03c4302e read-bitmap: gate body allocation on version; polish comments
inspectDeleteBitmap now rejects an unsupported version before allocating the
body buffer, mirroring DeleteBitmap::deserialize (magic -> version -> body_size
bound -> allocate). read-bitmap reports the header then throws
UNKNOWN_FORMAT_VERSION. Trailing-bytes-after-CRC stays deliberately tolerant.
Trim verbose comments across the touched files; functional test gains an
unsupported-version case.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-18 21:59:10 +08:00
murphy-4oandClaude Opus 4.8 0db55f5ff0 Add read-bitmap command to clickhouse-disks
Inspect a per-part Roaring delete-bitmap (.rbm) sidecar and print a header +
stats summary: format magic/version, CRC validity, cardinality (deleted-row
count), row range, and -- with --values -- a dump of all set bits (the deleted
row offsets) in ascending order.

Tolerant of corruption: a bad CRC still prints the header and flags CORRUPT, a
non-.rbm file reports bad magic, a malformed roaring body is reported rather
than crashed on, and a missing path is rejected up front (FILE_DOESNT_EXIST).

The non-throwing inspector (inspectDeleteBitmap) is declared in DeleteBitmap.h
and implemented in DeleteBitmap.cpp next to serialize/deserialize, so the .rbm
byte layout keeps one authority. clickhouse-disks is a symlink to the unified
clickhouse binary, which links dbms, so the command resolves it directly.

Tests: tests/queries/0_stateless/04400_clickhouse_disks_read_bitmap.sh and
DeleteBitmapInspectTest unit cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-18 16:31:32 +08:00