Skip to content

skip empty deduplication tokens#97460

Merged
CheSema merged 1 commit intomasterfrom
chesema-fix-empty-token
Feb 20, 2026
Merged

skip empty deduplication tokens#97460
CheSema merged 1 commit intomasterfrom
chesema-fix-empty-token

Conversation

@CheSema
Copy link
Member

@CheSema CheSema commented Feb 20, 2026

Due to this injected exception

2026.02.19 23:40:16.383165 [ 8263 ] {95dfe8f2-17fa-4b36-aea9-b31ed884412b} <Error> AsynchronousInsertQueue: Failed parsing for query 'INSERT INTO test_1.async_inserts_native (m) FORMAT Native' with query id 4e00b9b9-6852-4902-a9cc-accb959ce24c. DB::Exception: Query memory tracker: fault injected. Would use 19.29 MiB (attempt to allocate chunk of 4.02 MiB), maximum: 9.31 GiB

A token with 0 rows is added

2026.02.19 23:40:16.392908 [ 8263 ] {95dfe8f2-17fa-4b36-aea9-b31ed884412b} <Test> DedupInfo: setUserToken: token= count=0, instance_id: 4514, async, enabled, level SOURCE,
 rows/tokens 1000/2, in block: null, tokens: 2:[-::1000,-::1000], visited views: 0:[], retried view id: <empty>, original block id: <empty>, unification_stage OLD_SEPARATE
_HASHES

After first token has been filtered we have empty block but 1 token is left.
And this chassert is triggered

if (removed_rows == block.rows())
    {
        chassert(removed_tokens == getCount());

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):

skip empty deduplication tokens

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Feb 20, 2026

Workflow [PR], commit [a51b298]

Summary:

job_name test_name status info comment
Stateless tests (arm_asan, azure, parallel) failure
00752_low_cardinality_mv_1 FAIL cidb
Logical error: Tables UUID does not match after RESTART REPLICA (old: A, new: B) (STID: 4373-3c9f) FAIL cidb, issue
Finish Workflow failure
python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py failure

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Feb 20, 2026
@CheSema CheSema changed the title skip empty tokens skip empty deduplication tokens Feb 20, 2026
@azat azat self-assigned this Feb 20, 2026
Copy link
Member

@azat azat left a comment

Choose a reason for hiding this comment

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

Should setUserToken be even called for empty chunks?

@CheSema
Copy link
Member Author

CheSema commented Feb 20, 2026

Should setUserToken be even called for empty chunks?

I could change it, but code there looks fine. Entry is rolled back, buffer is rolled back, 0 rows are returned.
So I think this patch is just enough.

@CheSema CheSema added this pull request to the merge queue Feb 20, 2026
Merged via the queue into master with commit e2ec1de Feb 20, 2026
286 of 290 checks passed
@CheSema CheSema deleted the chesema-fix-empty-token branch February 20, 2026 23:08
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 20, 2026
Algunenano pushed a commit to Algunenano/ClickHouse that referenced this pull request Feb 24, 2026
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 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.

3 participants