Skip to content

fix(clickhouse): key structlog synthetic rows apart from their CALL row - #927

Merged
samcm merged 1 commit into
masterfrom
feat/structlog-synthetic-key
Oct 20, 2026
Merged

samcm merged 1 commit into
masterfrom
feat/structlog-synthetic-key

Conversation

@samcm

@samcm samcm commented Oct 20, 2026

Copy link
Copy Markdown
Member

execution-processor writes an extra row after every CALL-family opcode whose target ran no code. It reuses the CALL's index, so it had the same sorting key as the CALL row in canonical_execution_transaction_structlog and ReplacingMergeTree kept only one of the two.

Migration 023 adds a synthetic Bool column to both tables and appends it to the _local sorting key in the same ALTER, which ClickHouse applies as a metadata-only change (existing parts are not rewritten, and the primary index stays on the original four columns). It also rewrites the call_to_address comment to cover CREATE/CREATE2 rows and regenerates the structlog files in pkg/proto/clickhouse. The processor side, which sets synthetic = true on those rows, ships in execution-processor v0.4.0.

execution-processor adds a row after every CALL-family opcode whose target
ran no code. It reuses the CALL's index, so it shared the full sorting key
of canonical_execution_transaction_structlog with the CALL row and
ReplacingMergeTree kept only one of the two.

Migration 023 adds a Bool `synthetic` column and appends it to the sorting
key in the same ALTER, which ClickHouse applies as a metadata-only change
(no part rewrite, no mutation; the primary index stays on the old four
columns). It also documents call_to_address for CREATE/CREATE2 rows.
@samcm
samcm force-pushed the feat/structlog-synthetic-key branch from 3b4825b to 5722605 Compare October 20, 2026 09:44

@redpandabot redpandabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

No blocking issues found.


Reviewed 6 changed file(s) @ 5722605d — no blocking issues found.
Red pandas have a false thumb: an enlarged wrist bone evolved for gripping bamboo.

@samcm
samcm merged commit 142003c into master Oct 20, 2026
11 checks passed
@samcm
samcm deleted the feat/structlog-synthetic-key branch October 20, 2026 11:19
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.

1 participant