Repository navigation
Cherry pick #101292 to 26.4: Fix UBSan in MergeTreeDataPartWriterCompact::cancel - #103697
Merged
robot-ch-test-poll1 merged 25 commits intoMay 6, 2026
Merged
Conversation
`streams_by_codec` can contain null entries when `addStreams` partially fails: `std::map::operator[]` value-initializes (inserts null) before `std::make_shared<CompressedStream>` runs, and if the allocation throws, the null entry persists. When `cancel` is later called (e.g. from the background executor's catch block), iterating and dereferencing these null entries is undefined behavior caught by UBSan. Add a null guard, consistent with the base class `MergeTreeDataPartWriterOnDisk::cancel` which already guards its optional stream pointers. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ll check Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…` as `long`, `no-flaky-check` These tests consistently exceed the flaky check time limit. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…0091_union_race_conditions_2` These tag-only changes (`long`, `no-flaky-check`) were unrelated to the UBSan fix and triggered bugfix-validation failures because the modified tests don't catch the bug being fixed. Move them to a separate PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…xception Adds a `compact_part_writer_fail_in_add_streams` failpoint and a SQL test that forces `addStreams` to throw mid-merge. Without the fix, the old `streams_by_codec[codec_id]` `operator[]` would have left a null `shared_ptr` in the map, so `cancel` (which iterates the map and calls `stream->cancel`) would dereference a null pointer. The test follows the same pattern as `04077_wide_part_writer_cancel_on_exception.sql`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…riter-cancel # Conflicts: # src/Common/FailPoint.cpp
…ancel Fix UBSan in MergeTreeDataPartWriterCompact::cancel
Member
|
Dear @alexey-milovidov, @tuanpach, this cherry-pick PR has not been updated for 3d1h35m0s. Please resolve the conflicts to backport #101292, or close this PR if the backport is no longer needed. This PR will be automatically closed after 7 days of inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #101292
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job