Skip to content

Fix overflow while parsing in system.zookeeper_info#111629

Open
kssenii wants to merge 2 commits into
masterfrom
zookeeper-info-number-overflow
Open

Fix overflow while parsing in system.zookeeper_info#111629
kssenii wants to merge 2 commits into
masterfrom
zookeeper-info-number-overflow

Conversation

@kssenii

@kssenii kssenii commented Jul 23, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix overflow while parsing in system.zookeeper_info

All numeric fields of the four letter command responses were parsed into
32-bit int: Zxid via overflow-checked parseIntInBase, so any zxid above
2^31 - 1 made a query to the table fail with CANNOT_PARSE_NUMBER
exception "Overflow while parsing a number", and the remaining fields
via unchecked parse<int>, so values above 2^31 - 1 silently wrapped
around. Parse Zxid as Int64 and the rest as UInt64, matching the column
types. Return NULL for zk_open_file_descriptor_count and
zk_max_file_descriptor_count, where Keeper reports -1 when it cannot
determine the value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@clickhouse-gh

clickhouse-gh Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c38cc9a]


AI Review

Summary

This PR fixes system.zookeeper_info so four-letter-command counters are parsed into their declared widths instead of 32-bit int, and it maps Keeper's -1 file-descriptor sentinel to NULL instead of a wrapped UInt64 value. On the current head, the implementation and the added integration test line up with that contract, and I did not find any remaining correctness or compatibility issues in the touched code.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 23, 2026

@alesapin alesapin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just be sure that XID and ZXID are signed (they are).

@alesapin alesapin self-assigned this Jul 23, 2026
Comment thread tests/integration/test_zookeeper_info_number_overflow/test.py Outdated
The old version cannot be pinned by a moving tag like 26.2, which will
receive the fix through a backport. The current-version assertions alone
fail without the fix, so the pinned instance is not needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants