{{ message }}
Fix deltaSumTimestamp returning wrong results for signed integer types crossing zero#104830
Merged
Conversation
…pes crossing zero
Contributor
This was referenced May 15, 2026
Member
|
This was fixed by #105146. Let's update the branch. |
1 task
1 task
Maoyao233
pushed a commit
to Maoyao233/ClickHouse
that referenced
this pull request
Jun 8, 2026
`test_hedged_requests/test.py::test_stuck_replica` is chronically flaky
on heavily overcommitted ASan/UBSan integration shards. The failure shape
in CIDB is identical across 9 unrelated PRs in the past 30 days:
pause_container('node_1') did not become observably effective within
90.0s ... still succeed after ~890 probe iterations; last outcome:
server replied (4 bytes)
The probe in `_wait_for_pause_effective` keeps receiving live ClickHouse
exception packets from `node_1` for the entire 90s budget, which proves
that `docker compose pause` returned success while the cgroup freezer
never actually froze the user-space tasks. The existing SIGSTOP fallback
in `ClickHouseCluster.pause_container` only fires when `docker compose
pause` raises an exception, not when it lies about success, so the
escalation path was never taken.
Switch this test to `cluster.pause_container_using_signal`, which uses
`SIGSTOP`/`SIGCONT` from the start. A signal cannot be silently lost the
way the cgroup freezer can, so the pause becomes observable on the very
first probe iteration. Same helper is already used by
`test_postgresql_replica_database_engine` for the same reason.
The change is local to one call site. The chronic flake hit
`Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/6)` in the
following PRs (CIDB, last 30 days): ClickHouse#103404, ClickHouse#106311, ClickHouse#105010, ClickHouse#105056,
ClickHouse#104830, ClickHouse#106025, ClickHouse#100391, ClickHouse#106571, ClickHouse#103229. All show the same
`server replied (4 bytes)` outcome, distinguishing this from generic
flakiness.
Related: ClickHouse#106571
04234 collided with several tests added on master since the branch diverged; move deltaSumTimestamp test to the next free number 04339.
The fix also changes dispatch for Int8/Int16 value types in `createWithTwoTypes` and for signed Int32/Int64 timestamp types in `createWithTwoTypesSecond`, but the test only exercised Int32/Int64 values with unsigned timestamps. Add focused cases crossing zero for: - Int8 and Int16 values; - the result type of every signed value width; - Int32 and Int64 signed timestamps (via state merge ordering). Addresses the review feedback on uncovered code paths.
The previous comment justified treating signed and unsigned data types the same way, which is exactly what introduced the bug: the serialized binary representation is identical, but the arithmetic differs once values cross zero. Document this so the unification is not reintroduced.
Contributor
LLVM Coverage ReportChanged lines: Changed C/C++ lines covered by tests: 16/16 (100.00%) | Lost baseline coverage: none · Uncovered code |
evillique
approved these changes
Jun 15, 2026
evillique
left a comment
Member
There was a problem hiding this comment.
Just to be sure, this is backwards compatible with the states already stored in tables?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
deltaSumTimestampreturning wrong results for signed integer types crossing zero. Resolves #104750.Version info
26.6.1.830