Skip to content

fix: KeeperMap DELETE exits after first block instead of continuing loop - #112438

Closed
waterWang wants to merge 1 commit into
ClickHouse:masterfrom
waterWang:fix/keepermap-delete-return-continue
Closed

waterWang wants to merge 1 commit into
ClickHouse:masterfrom
waterWang:fix/keepermap-delete-return-continue

Conversation

@waterWang

Copy link
Copy Markdown

Fixes #112244

Summary

In StorageKeeperMap::mutate(), the DELETE branch uses return; after successfully deleting the first block of matched rows. This causes the function to exit the while (executor.pull(block)) loop after processing only the first block, silently leaving all remaining matched rows undeleted.

Fix

Changed return; to continue; at line 1696 so that mutate() processes every block of matched rows, not just the first one.

Impact

Without this fix, a DELETE FROM KeeperMap WHERE <predicate> that matches more than max_block_size (default 65409) rows will silently delete only the first block and report success. The remaining rows are left in the table, and system.mutations shows is_done = 1 with no error.

@CLAassistant

CLAassistant commented Jul 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


water seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@scanhex12 scanhex12 self-assigned this Jul 29, 2026
@scanhex12 scanhex12 added the can be tested Allows running workflows for external contributors label Jul 29, 2026

@scanhex12 scanhex12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good, but please add a test

@clickhouse-gh

clickhouse-gh Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b1937e4]

Summary: ❌

job_name test_name status info comment
Config Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/pr_labels_and_category.py FAIL
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/pr_body_check.py FAIL
Dockers Build (amd) DROPPED
Dockers Build (arm) DROPPED
Dockers Build (multiplatform manifest) DROPPED
Style check DROPPED
Code Review DROPPED
Docs check DROPPED
Docs check (Mintlify) DROPPED
Fast test DROPPED

@scanhex12

Copy link
Copy Markdown
Member

and change the description like in template

@alexey-milovidov

Copy link
Copy Markdown
Member

Reimplemented together with the regression test requested in review in #112777 — thank you for finding and fixing this!

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 spam

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeeperMap DELETE silently deletes only the first block (max_block_size) and reports success

4 participants