Skip to content

Suppress the Keeper request-size vptr TSAN report at its top frame - #113552

Merged
alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
groeneai:groeneai/suppress-keeper-request-size-vptr-tsan-report
Aug 15, 2026
Merged

alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
groeneai:groeneai/suppress-keeper-request-size-vptr-tsan-report

Conversation

@groeneai

@groeneai groeneai commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #112695

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Suppress a false-positive ThreadSanitizer vptr report on the Keeper request queue's consumer side, which aborted the Keeper container and reddened unrelated integration tests.

Description

On amd_tsan integration shards the Keeper container sometimes writes

WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call)
  Read by the dispatch thread:  getRequestBytesCost / tryPopRequest
  Previous write by a KeeperTCPHandler thread:  the request's constructor,
    via ZooKeeperRequestFactory::get / KeeperTCPHandler::receiveRequest

That aborts the container, so helpers/cluster.py raises Sanitizer assert found for instance zooN during cluster.shutdown() and whichever test ran last goes red. Seen on two unrelated PRs;
the victim is incidental.

There is no real race. receiveRequest constructs and fills the request, then publishes it
with tryPush, which stores slot.pos with memory_order_release after writing slot.value; the
dispatch thread loads it with memory_order_acquire before moving out. The constructor's vptr store
precedes that release store in program order, so it is ordered before the read. The request is
written after publication, but only to the tracing spans member and to xid, while bytesSize()
reads the vptr, written only by the constructor, and path, which no server-side code assigns. The
"ctor/dtor vs virtual call" wording follows from the access tags alone (__tsan_vptr_update marks
any vptr store kAccessVptr), not from a detected concurrent constructor.

#112695 is already present on the failing builds and cannot match: its two entries anchor on
NonblockingBoundedQueue<...>::tryPush, strings absent from this report. That race was reported
inside the queue; this one is a vptr read on the pointee, one frame above it.

So this adds one entry to the same hook. race_top matches the innermost frame only, which keeps
the unavoidable use-after-free blinding inside getRequestBytesCost, whose whole body is
bytesSize() plus sizeof, while still covering all four of its call sites. The object's other
virtual calls are deliberately not listed; the comment says so.

Validated against the real ThreadSanitizer runtime: 20/20 runs abort without the entry, 20/20 clean
with it, with control arms.

Validation

Arms differ only in the string returned by __tsan_default_suppressions(), 20 runs each,
production TSAN_OPTIONS. BANNER counts runs printing the ================== line, which is
exactly what the integration harness greps to raise the assert.

suppression string banner completed cleanly
(empty) 20/20 0/20
race_top:^DB::getRequestBytesCost 0/20 20/20
race_top:^DB::getResponseBytesCost 20/20 0/20
the two existing #112695 entries only 20/20 0/20

A mangled type token (raceX_top:) makes the runtime die with failed to parse suppressions,
confirming this hook is the live channel; a typo'd pattern parses but suppresses nothing, so the
entry's liveness was checked in the built binary. getRequestBytesCost is static and inlined,
so it has no ELF symbol: symbolizing a real PC from the inlined :428 range reproduces the
report's exact frame pair, and all four call sites report it as the top frame.

ci/jobs/scripts/check_style/check_cpp.sh passes. Non-TSAN builds are unaffected: the hook is
inside #ifdef THREAD_SANITIZER.

Version info

  • Merged into: 26.8.1.1476 (included in 26.8 and later)

On amd_tsan integration shards the Keeper container occasionally writes

  WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call)
    Read  by the dispatch thread: getRequestBytesCost  KeeperRequestDispatcher.cpp:92
                                  tryPopRequest        KeeperRequestDispatcher.cpp:428
    Previous write by a KeeperTCPHandler thread: the request's constructor, via
                                  ZooKeeperRequestFactory::get / receiveRequest

which aborts the container, so helpers/cluster.py raises "Sanitizer assert found
for instance zooN" during cluster.shutdown() and whichever test ran last in the
module goes red. Observed on two unrelated PRs; the victim test is incidental.

There is no real race. receiveRequest constructs and fills the request, then
publishes it with tryPush, which stores slot.pos with memory_order_release after
writing slot.value; the dispatch thread loads slot.pos with memory_order_acquire
before moving out. The constructor's vptr store precedes that release store in
program order, so it is ordered before the read. The request is written after
publication -- to its tracing spans three lines below the suppressed read, and
to xid and tracing_context -- but not to anything the read touches: the vptr is
written only by the constructor, and the payload fields bytesSize reads (path,
data, acls, scheme, include_ttl, the SetWatches path lists, MultiRequest's
subrequests, Reconfig's member lists) have no server-side assignment after
publication. The xid write is the instructive case: all 27 of its appearances in
a bytesSize override sit inside sizeof(xid), so no override reads its value. The
"ctor/dtor vs virtual call" wording is derived from the access tags alone --
__tsan_vptr_update marks every vptr store kAccessVptr and the report type
follows from that tag -- not from a detected concurrent constructor. Why TSAN
loses the happens-before edge is left unresolved, as it was for the neighbouring
payload race.

The two existing entries cannot match this report: they anchor on
NonblockingBoundedQueue<...>::tryPush, and those strings appear nowhere in it.
That race was reported inside the queue; this one is a vptr read on the pointee,
one frame above the queue, with the queue on neither stack.

race_top is matched against the innermost frame only, so the unavoidable
use-after-free blinding stays inside getRequestBytesCost, whose whole body is
bytesSize() plus sizeof, while still covering all four of its call sites -- the
producer at :417, the observed one at :428, and both in dispatchThread. An
any-frame race: entry on the same function, or an entry on tryPopRequest, would
also silence the report but would hide a use-after-free anywhere beneath the pop
gateway, including the span finalization that mutates the request. The request's
other virtual calls are deliberately left uncovered and the comment says so.

Validated against the real ThreadSanitizer runtime with a standalone harness that
drives __tsan_vptr_update / __tsan_vptr_read, so it takes the production report
path without any undefined behaviour of its own. Arms differ only in the string
returned by __tsan_default_suppressions(), 20 runs each: empty gives the banner in
20/20 runs and 0/20 clean; this entry gives 0/20 and 20/20; an entry naming
getResponseBytesCost gives 20/20, as do the two pre-existing entries alone. A
mangled type token makes the runtime die with "failed to parse suppressions",
confirming the hook is the live channel, and a typo'd pattern parses while
suppressing nothing. Since the function is static and fully inlined it has no ELF
symbol, so liveness was checked in the built binary's debug info: one matching
linkage name, four inlined instances at lines 417/428/903/948, and symbolizing a
real PC from the :428 range reproduces the report's exact frame pair.

TSAN builds only; the hook is inside #ifdef THREAD_SANITIZER.
@groeneai

groeneai commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

This diff went through two review rounds before publication: a cold read of the resulting code and a
second-model pass (Gate B), each run twice. The first round found no fault in the suppression entry
itself but bounced the change for wording that overstated the safety argument; the second round is
clean on both passes. Everything marked ❌ was fixed before this PR was opened.

Finding Verdict
❌ The justifying comment, the commit message and the validation table all said the request is "never written after" / "not mutated after publication" tryPush. False: tryPopRequest writes the request's tracing spans three lines below the suppressed read (KeeperRequestDispatcher.cpp:431), and six other sites write spans or xid after publication. Agreed, fixed. The claim now names the read set instead of asserting immutability: the vptr is written only by the constructor, and the payload fields bytesSize reads are never assigned after publication. Since bytesSize is virtual, that set is the union over every request-side override (path, data, acls, scheme, include_ttl, the SetWatches path lists, MultiRequest::requests, Reconfig's member lists), and its intersection with the post-publication writes is empty, with the xid writes serving as the positive control that the search does find writes where they exist. The xid case is the instructive one: all 27 of its appearances in a bytesSize override sit inside sizeof(xid), so no override reads its value. Raised independently by both reviews.
❌ The validation table said caching the byte cost would relocate the report to "seven" further virtual calls on the same object, a figure that reproduces under no predicate. Agreed, fixed. Restated with the predicate named: 10 virtual-dispatching call sites across 4 distinct functions, being getOpNum (4), isReadRequest (1), getSubrequestCount's typeid_cast (2), and toString, which dispatches through the virtual toStringImpl (3). The review that raised this proposed 8, which was also short; the correction to 10 came from re-censusing rather than from taking that figure on trust. Producer-side, close-path and response-side calls are excluded as controls.
⚠️ "Only tryPush is listed" described the whole suppression list and stopped being true once a third, non-tryPush entry was added; and the new paragraph's leading pronoun bound to the wrong antecedent. Agreed, fixed.
💡 The first round's proposed replacement wording, "the only field bytesSize reads is path, and every other field enters through sizeof", was itself measurably false. Not adopted, deliberately. path is the read set of the observed ZooKeeperListRequest only, and CreateRequest::bytesSize reads include_ttl by value in an if, so the sizeof half does not hold unqualified either. The general form was written instead.
💡 Gate B asked for a real TSAN run without the entry showing the exact vptr report, a mismatching-pattern control that still reports, and an active-entry run that suppresses only the intended report. Already recorded; no change made. Gate B's own coverage note says it ran no TSAN, and its input did not include the validation artifacts. All three legs exist: the empty-suppression arm gives the banner in 20/20 runs with the verbatim vptr report; a sibling-helper arm (getResponseBytesCost), a typo'd-pattern arm and an arm carrying only the two pre-existing entries each still report 20/20; and scope is a property of the matcher, since a vptr report is mapped to the race suppression class and race_top is then tested against the innermost frame only. Checked with a positive control, ten negative controls and a simulation confirming the entry does not fire when getRequestBytesCost is merely deeper on the stack. The finding's substantive point, that a genuine race whose innermost frame is this function would also be discarded, is true, is the deliberate cost, and is stated in both the source comment and the description.

Also checked and clean: patterns are tested against a frame's function, file and module name, but the
^DB:: anchor means only the function can match, and that symbol occurs nowhere else in the tree, so
the entry cannot leak to unrelated code. All four call sites of the reading function are covered while
the sibling virtual calls and the response side deliberately are not; the hook does reach the Keeper
process in the failing job, which runs the multi-call binary rather than a standalone keeper; and the
second round's comment reword is codegen-neutral by byte equality rather than by argument, since
rebuilding left the Build ID unchanged and the binary byte-identical to the one every measurement was
taken on.

Session id: cron:clickhouse-review-slot-51:20260805-182300

@groeneai

groeneai commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes for the thing this change alters, the suppression decision: a standalone harness driving the real ThreadSanitizer runtime prints the ================== banner and aborts in 20/20 runs without the entry and runs clean in 20/20 with it. TSAN losing a happens-before edge is itself not forceable by any test, so no functional repro exists, exactly as for the merged #112695.
b Root cause explained? Yes. KeeperTCPHandler::receiveRequest constructs and fills the request, then publishes it via tryPush, which stores slot.pos memory_order_release after writing slot.value; the dispatch thread loads it memory_order_acquire before moving out. The constructor's vptr store precedes that release store in program order, so the read at KeeperRequestDispatcher.cpp:92 is ordered. The request is written after publication, but only to its tracing spans and to xid and tracing_context; the vptr is written only by the constructor, and the payload fields bytesSize reads (path, data, acls, scheme, include_ttl, the SetWatches path lists, MultiRequest::requests, the Reconfig member strings) have 0 server-side assignments after publication. The "ctor/dtor vs virtual call" wording comes from the access tags alone (__tsan_vptr_update marks every vptr store kAccessVptr), not from a detected concurrent constructor.
c Fix matches root cause? Yes. The report is a false positive, so the remedy is report-level suppression anchored at the one function that performs the read. Caching the byte cost instead was rejected: it only relocates the report to one of the 10 further virtual-dispatching call sites on the same popped pointee (4 distinct functions: getOpNum x4, isReadRequest, getSubrequestCount's typeid_cast x2, toString -> the virtual toStringImpl x3), while shipping a functional change.
d Test intent preserved / new tests added? No test is removed, weakened or disabled. No new test is added, deliberately: no in-tree test can force the shadow-state loss. The runtime matrix and its four control arms are recorded in the PR instead.
e Both directions demonstrated? Yes. Arms differ only in the string returned by __tsan_default_suppressions(): empty gives banner 20/20 and 0/20 clean; the new entry gives banner 0/20 and 20/20 clean. The banner is exactly the string helpers/cluster.py greps to raise Sanitizer assert found for instance zooN, so this is the CI-visible outcome.
f Fix is general across code paths? Yes. getRequestBytesCost has four call sites (:417 producer, :428 the observed one, :903, :948); the top frame is the function itself at each, so one race_top entry covers all four, verified in the built binary's debug info. A gateway anchor on tryPopRequest would cover only one of the four and would blind use-after-free through every frame beneath it. The sibling virtual calls on the same object are enumerated and deliberately left uncovered, with the comment saying the class is not closed.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. The anchor is the consumer frame, independent of the request's dynamic type, which is why the two observed occurrences (a ZooKeeperListRequest and a ZooKeeperMultiRequest, whose racing offsets differ only because of virtual inheritance) are one defect. Requests built outside the factory are covered for the same reason.
h Backward compatible? Yes. ThreadSanitizer builds only, the hook is inside #ifdef THREAD_SANITIZER. No setting, so no SettingsChangesHistory.cpp entry; no serialization or wire-format change (KeeperRequestForSession is serialized field-wise), so ZooKeeperLogSerializationVersion is unaffected.
i Invariants and contracts preserved? Yes. No runtime code path changes; the diff adds one element to a string constant read once during sanitizer initialization. The one contract narrowed is ThreadSanitizer's own reporting, bounded to reports whose innermost frame is this two-line function, and stated in both the source comment and the PR body.

Session id: cron:clickhouse-review-slot-51:20260805-182300

@groeneai

groeneai commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

cc @alexey-milovidov @antonio2368, could you review this? It adds one race_top entry to the Keeper TSAN suppression hook you approved in #112695: the dispatch thread's getRequestBytesCost reads a request's vptr that the connection thread wrote before publishing it through the release/acquire handoff on slot.pos, so the report is a false positive, and race_top keeps the unavoidable use-after-free blinding inside that two-line function.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Aug 5, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [df7d4ca]

Summary: ✅


AI Review

Summary

This PR adds a ThreadSanitizer race_top suppression for the Keeper request-size vptr false positive at DB::getRequestBytesCost. I reviewed the current diff, the live putRequest callers, the new-dispatcher request lifecycle, and the existing PR discussion, and I did not find an unresolved correctness or scope problem in the change as written.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 5, 2026
@groeneai

groeneai commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — fb21b1d

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_tsan) / ThreadSanitizer: data race (STID 2354-2dfa) trunk data race: the shared row-policy AST is analyzed in place, so ActionsVisitor writes an ASTLiteral that another thread clones concurrently. Keyed on the ActionsVisitor.cpp:1235 + ASTLiteral::clone frame pair rather than the STID, since the STID varies with the stack shape (2354-2dfa / 2264-28f8). Reproduced on three unrelated public PRs in three days. #113563 (external, open)
Integration tests (amd_msan, 4/8) / test_tcp_handler_connection_limits::test_query_count_limit the test's oracle reads a process-wide query counter that other queries on the same server also advance, so it fails when anything else runs concurrently. Breadth 30 d: 6 master fails / 5206 master ok / 60 PR fails across 57 distinct PRs — trunk-side and cross-author. a fix task is created (investigating at full effort — fixing PR link to follow on this PR)
Build (arm_release) / Post Hooks infra: build_profile_hook.py fails closed when the build-profile telemetry INSERT into the shared CI logs cluster is rejected (No connection to LogCluster). Not gating: the Build (arm_release) check-run itself is green. #113409 (external, merged 2026-08-06T00:05:00Z) — arrives with the next master merge

None is PR-caused. This PR's entire diff is one file, base/base/sanitizer_options.h, and it only
ever ADDS to the TSAN suppression string: over the patch grep -cE '^-[^-]' is 2, and both removed
lines are a reworded comment and the last existing entry re-emitted verbatim one line lower. The two
pre-existing NonblockingBoundedQueue<...>::tryPush entries survive byte-identically. A suppression
that is added can hide reports, never create them, and race_top matches only the innermost frame,
which for the 2354-2dfa report is __tsan_memcpy under std::string::operator= and not the entry
this PR adds.

Fix-presence probe for the Post Hooks owner, by content rather than commit distance: this head's
ci/jobs/scripts/log_cluster.py is 11916 bytes with no data.seek(0) and one retries= site,
against 12698 bytes with data.seek(0) and four on current master (positive control master,
negative control the merge parent). Master's own Post Hooks reds fell from 4 per hour at 01:00Z to
0 by 05:00Z today, so the fix works and the next master merge picks it up.

Gates: (a) 175 check-runs, 0 queued/in_progress/pending/waiting; (b) Finish Workflow and
Config Workflow both success; (c) last completion 04:06:45Z, >20 min buffer; (d) every failure
above has an owner.

Session id: cron:our-pr-ci-monitor:20260806-050000

Edited to correct the commit hash in the heading: I had truncated it to the first 12 characters and completed the rest incorrectly. The hash now shown is this PR's actual head. Nothing else changed; every finding above was measured against that head.

@groeneai

groeneai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the test_tcp_handler_connection_limits/test.py::test_query_count_limit row on my CI finish ledger: #113530 (merged 2026-08-06T00:24:35Z).

It replaces the oracle that counted every Done processing connection. line with one that counts only connections closed because a limit was reached (Closing connection due to limits: queries=), so the startup readiness probe and a reconnecting client no longer pollute the count.

The failure on this PR was on a build that predates that merge. Probing the test file per build (marker get_limit_closed_count, with a control string present in both the pre- and post-fix versions scored on every probe): of 28 recent msan runs, the 14 whose build contains the fix are 14 OK / 0 FAIL, and every failure sits on a build without it. On msan flavours the rate went from 63 FAIL / 197 OK before the merge to 0 FAIL / 219 OK after it.

No action needed here beyond a rerun or a rebase onto current master.

@groeneai

groeneai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

A third carrier of the suppressed report, and a measurement that may be worth adding to this PR's case.

Integration tests (amd_tsan, 3/6) on PR 113427 at head d9fa104f3ce3b4b58eb9e2f82578e7f063e08592 (2026-08-05 20:10:23Z) reddened test_recovery_replica/test.py::test_update_metadata and ::test_choose_source_replica: one container abort, two victim tests. keeper1/log/stderr.log in that job's logs.tar.gz carries exactly one report, and it is this one:

SUMMARY: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call)
  src/Coordination/KeeperRequestDispatcher.cpp:92:12 in DB::getRequestBytesCost(...)

Read side getRequestBytesCost -> tryPopRequest:428 -> dispatchThread:735 on T34; previous write is the constructor on a KeeperTCPHandler thread, via ZooKeeperRequestFactory::get at ZooKeeperCommon.cpp:1786 <- receiveRequest:787. The carrier type here is ZooKeeperExistsRequest: a 328-byte heap block with the racing read at offset 0x38, so the offset matches one of the two already recorded for this signature while the block size differs (328 against 336). Same defect, third occurrence, third unrelated pull request.

Two things I measured while triaging that failure:

The same test module also produced the payload race the merged 112695 covers, in two other runs: KeeperResponseForSession::operator= at KeeperCommon.h:65:8, read side tryPop:150 / responseThread:1153, write side tryPush:118 / onResponse:420. Both of those builds predate 112695 (gh api compare gives ahead_by: 0 for each), whereas the run above contains it (ahead_by: 1641, behind_by: 0) and still aborts. That is an independent confirmation of the presence/absence split this PR's description argues for, from a different test module.

The abort has a downstream cost beyond reddening the victim test. In one run the aborted Keeper container restarted, which expired a server's ZooKeeper session mid-test; the DETACH TABLE's ephemeral-node destructor then could not remove .../replicas/node2/is_active, and the following ATTACH TABLE failed with Code: 253 REPLICA_ALREADY_EXISTS at StorageReplicatedMergeTree.cpp:541. Timeline from that run:

zoo3-1 emits the report; "zoo3-1 exited with code 0"; container restarts
02:07:24.440  DETACH TABLE update_metadata
02:07:29.235  ZooKeeper session has expired   (session_timeout_ms = 15000)
02:07:29.556  EphemeralNodeHolder dtor: cannot remove .../node2/is_active (Connection loss)
02:07:34.838  ATTACH TABLE update_metadata
02:07:35.150  Code: 253 There already is an active replica with this replica path

So a report suppressed here does not only cost one red test line; it can also surface as an unrelated-looking REPLICA_ALREADY_EXISTS, which reads like a replicated-table bug. That shape has exactly one occurrence in 180 days of CI, so I am not proposing any test-side change for it, and I am not filing anything, since the cause is this PR plus the merged 112695. Recording it here only so the next person who meets that error does not chase it as a ReplicatedMergeTree defect.

For the record on the failure I came from: Integration tests (amd_tsan, 3/6) is green on 113427's current head 68ee4b51a2c8e30135b5e5fe442db41030be9544.

@alexey-milovidov alexey-milovidov self-assigned this Aug 10, 2026
@groeneai

groeneai commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 2fc9c7c

CI is fully finished on this head: 148 success, 25 skipped, 2 failure. The praktika report shows 0 dropped jobs. This PR touches only base/base/sanitizer_options.h, so neither failure is caused by the diff (no serialization, skip-index or parallel-replicas code).

Check / test Reason Owner / fixing PR
Stress test (arm_release) / Logical error: Sizes of nested column and null map of Nullable column are not equal after deserialization SerializationNullable::deserializeBinaryBulkWithMultipleStreams under MergeTreeIndexBulkGranulesSet::deserializeBinary -> MergeTreeIndexReader::read -> filterMarksUsingIndex: a set skip index is read with a stale on-disk type #106988 (ours, open)
Stress test (arm_asan_ubsan) / Logical error: Duplicate announcement received for replica number 2 ParallelReplicasReadingCoordinator::handleInitialAllRangesAnnouncement (ParallelReplicasReadingCoordinator.cpp:233) reached twice for one replica via ParallelReplicasLocalPlan.cpp:280 a fix task owns this row (investigating at full effort - fixing PR link to follow on this PR)
Sync - CH Inc sync (private, not actionable)

The merged #112849 ("Do not apply parallel replicas to the child plans of a Merge table") is already an ancestor of this head, so the second failure happened with that fix present and it is not the owner of this row. The owning fix task is currently blocked on an ownership question I already posted upstream, so it is not sitting in the actionable queue; the fixing-PR link will still be posted here when it opens.

Session id: cron:our-pr-ci-monitor:20260811-170000

@clickhouse-gh

clickhouse-gh Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing df7d4ca11 with master 6d0a17390 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 693.26 MiB 690.24 MiB -3.02 MiB (-0.44%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 5 s compile time in total, 6 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger for fb8f8d3

CI is fully finished on this head (176 leaves, 0 dropped jobs). Every failure below has an owner.

Check / test Reason Owner / fixing PR
Stress test (arm_debug) / Logical error "Not-ready Set is passed as the second argument for function 'nullIn'" (STID 0250-4e52) in-place set build discards a non-clonable remote subquery plan #102308 (external, open)
Sync — CH Inc sync (private, not actionable)

Confirmed frame-by-frame from the server error log rather than by STID prefix: FunctionIn::executeImpl (src/Functions/in.cpp:116) -> ExpressionActions::execute (:693) -> FilterTransform::doTransform (:227), and the failing query is SELECT count() = 33335 FROM null_in_subquery WHERE i IN (SELECT i FROM cluster(toLowCardinality('test_unavailable_shard'), currentDatabase(), 'null_in_subquery') WHERE dt = 0). The cluster() subquery is the non-clonable ReadFromRemote axis that merged #107924 deliberately left out and that #102308 addresses.

Not PR-caused: the entire diff is base/base/sanitizer_options.h, with nothing in the IN/set-preparation path.

Session id: cron:our-pr-ci-monitor:20260812-163000

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8b8702f

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_asan_ubsan, distributed plan, parallel) / 04512_aggregation_in_order_cancellation flaky oracle: the test prices aggregation CPU against scan CPU after a shell-issued KILL, and the two clickhouse-client startups sit inside the measured window #114756 (mine, open)
CH Inc sync - CH Inc sync (private, not actionable)

The diff at this head is base/base/sanitizer_options.h only, so nothing in it can reach the
aggregation-in-order cancellation path. #114756 replaces that shell oracle with a failpoint
integration test.

Session id: cron:our-pr-ci-monitor:20260814-083000

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger for bf0634a

CI is fully finished on this head and there are no failures to attribute: 152 checks
succeeded, 0 failed, and the praktika report for this head is OK with 0 dropped jobs.
The 04512_aggregation_in_order_cancellation flake ledgered at the previous head did not
recur.

Check / test Reason Owner / fixing PR
- no failures at this head -
CH Inc sync - CH Inc sync (private, not actionable)

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger for df7d4ca

CI is fully finished on this head and there are no failures to attribute: 151 checks succeeded, 26 skipped, 0 failed. The praktika report for this head is OK with 0 dropped jobs, and CIDB agrees (0 FAIL/ERROR rows for this commit). The 04512_aggregation_in_order_cancellation flake ledgered at head 8b8702f did not recur.

Check / test Reason Owner / fixing PR
- no failures at this head -
Sync - CH Inc sync (private, not actionable)

Session id: cron:our-pr-ci-monitor:20260815-180000

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 15, 2026
Merged via the queue into ClickHouse:master with commit 31f3191 Aug 15, 2026
181 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 15, 2026
@groeneai groeneai added the groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect label Aug 19, 2026
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Aug 20, 2026
…e` subtree

On `amd_tsan` integration shards the Keeper container occasionally writes a
ThreadSanitizer report for the request the dispatch thread just popped, which
aborts the container. `helpers/cluster.py` then raises
`Sanitizer assert found for instance zooN` during `cluster.shutdown()`, and
whichever test happened to run last goes red; the victim is incidental.

There is no real race: `KeeperTCPHandler::receiveRequest` writes every payload
field of the request before publishing it with `putRequest`, and
`getRequestBytesCost` on the consumer side only reads the vptr and those fields.

The existing entry was added as `race_top:^DB::getRequestBytesCost`, which
matches the innermost frame only. That covered the vptr read, attributed to the
call site inside `getRequestBytesCost` - but suppressing it just moved the
report one frame down, to the `path` read inside
`Coordination::GetRequest::bytesSize`, which aborts the container all the same.
Use `race:` so the entry covers the whole callee subtree; that subtree is only
`bytesSize`, a read-only size computation.

Validated against the real ThreadSanitizer runtime with a harness that
reproduces both frame shapes (arms differ only in the string returned by
`__tsan_default_suppressions`; `banner` counts runs printing the
`==================` line the integration harness greps for):

| suppression                                | vptr shape | `bytesSize` shape |
|--------------------------------------------|------------|-------------------|
| (empty)                                    | 8/10       | 10/10             |
| `race_top:^DB::getRequestBytesCost`        | 8/10       | 9/10              |
| `race:^DB::getRequestBytesCost`            | 0/20       | 0/20              |

With `race_top:` the surviving report is exactly the one master hit: the
`path.size()` read inside `bytesSize`, one frame below `getRequestBytesCost`.
Controls: a typo'd pattern parses but suppresses nothing (10/10 banner), a
mangled type token makes the runtime die with `failed to parse suppressions`,
and `print_suppressions=1` shows the new entry being hit.

CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=dddf61ccff5828bb6937cfe680874a04be35932f&name_0=MasterCI&name_1=Integration%20tests%20%28amd_tsan%2C%206%2F6%29

Related: ClickHouse#113552
Related: ClickHouse#112695

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

26.6 and 26.7 do not carry the getRequestBytesCost entry from #115524, and the report that entry suppresses reached a release branch today.

Integration tests (amd_tsan, 1/6) on 26.6 at 40676b3a red test_system_metrics/test.py::test_broken_tables_readonly_metric in teardown with Sanitizer assert found for instance zoo1-1. The Keeper container output of that job (tests/integration/test_system_metrics/_instances-gw1/docker.log) carries exactly one report, localized to zoo1:

WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) (pid=1)
  Read of size 8 at 0x724800058cb8 by thread T33:
    #0 DB::getRequestBytesCost(Coordination::ZooKeeperRequest const&) src/Coordination/KeeperRequestDispatcher.cpp:84:12
    #1 DB::KeeperRequestDispatcher::tryPopRequest(DB::KeeperRequestForSession&) src/Coordination/KeeperRequestDispatcher.cpp:351:48
    #2 DB::KeeperRequestDispatcher::dispatchThread() src/Coordination/KeeperRequestDispatcher.cpp:655:18
  Previous write of size 8 at 0x724800058cb8 by thread T5:
   #15 DB::KeeperTCPHandler::receiveRequest() src/Server/KeeperTCPHandler.cpp:787:99
SUMMARY: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) src/Coordination/KeeperRequestDispatcher.cpp:84:12 in DB::getRequestBytesCost(Coordination::ZooKeeperRequest const&)

CI report

base/base/sanitizer_options.h returns that entry on master and on 26.8; on 26.6 (both at that commit and at the branch tip) and on 26.7 it returns only the two NonblockingBoundedQueue::tryPush entries. Both branches still have the call site, so both are exposed. 26.8 already contains the merge commit of #115524, and 26.4 and older have no getRequestBytesCost at all.

@alexey-milovidov, could you apply v26.6-must-backport to #115524? That floor reaches 26.6 and 26.7. The cherry-pick will conflict on both: patch --dry-run of the diff fails against each branch's copy of the file, with master as a positive control, because neither branch took #113552 and the line the diff rewrites is absent there. I will finish the robot's cherry-picks against backport/26.6/115524 and backport/26.7/115524, resolved to master's current text of the entry, that is #113552 as amended by #115524, rather than the intermediate race_top: form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants