Repository navigation
Fix deltaSumTimestamp returning wrong results for signed integer types crossing zero - #104830
Conversation
…pes crossing zero
|
Workflow [PR], commit [0a73b6e] Summary: ✅
AI ReviewSummaryThis PR fixes Final VerdictStatus: ✅ Approve |
|
This was fixed by #105146. Let's update the branch. |
`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.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 16/16 (100.00%) | Lost baseline coverage: none · Uncovered code |
evillique
left a comment
There was a problem hiding this comment.
Just to be sure, this is backwards compatible with the states already stored in tables?
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