Insert profile event fix for async inserts with inline data#98962
Insert profile event fix for async inserts with inline data#98962npakeer merged 9 commits intoClickHouse:masterfrom
Conversation
Co-authored-by: Sergei Trifonov <svtrifonov@gmail.com>
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (7/7) |
| if (result.status == AsynchronousInsertQueue::PushResult::OK) | ||
| { | ||
| // Increment InsertQuery for async insert with inline data | ||
| ProfileEvents::increment(ProfileEvents::InsertQuery); |
There was a problem hiding this comment.
why don't we do it at the same place as for ProfileEvents::AsyncInsertQuery?
There was a problem hiding this comment.
@yakov-olkhovskiy The problem is happening only for async inserts with inline data. If we increment InsertQuery at the same place as AsyncInsertQuery, then InsertQuery will be double incremented for non inline data. For non inline data, it seems to go through InterpreterFactory.get() where the profile event event is incremented.
If my understanding is correct.
Inline async inserts go through here
Non In line async inserts goes through this. See last line of selection here:
InterpreterFactory.get() is incrementing profile event for noninline data. I did test for non inline async data, and InsertQuery is incrementing correctly. Let me know if you still have any questions.
There was a problem hiding this comment.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Increment InsertQuery ProfileEvent for async inserts. Fixes the issue - #98626
Documentation entry for user-facing changes
Async inserts with inline data are not being counted in InsertQuery profile event. This fix also increments InsertQuery profile event for async inserts with inline data .
Note
Low Risk
Small, metrics-only change in the async INSERT path plus a new integration test; low risk aside from potential monitoring/alerting deltas due to corrected counters.
Overview
Fixes a ProfileEvents counting gap for async INSERTs. When an async INSERT with inlined data is successfully enqueued (
pushQueryWithInlinedDatareturnsOK),executeQuery.cppnow also incrementsProfileEvents::InsertQuery(in addition to existing async-specific counters).Adds coverage. New integration test
test_insert_query_profile_eventsassertsInsertQueryincreases for both sync and async inserts whileAsyncInsertQueryincreases only for async inserts, with a minimal config (page_cache_size=0) for deterministic runs.Written by Cursor Bugbot for commit 629aa28. This will update automatically on new commits. Configure here.