Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hash join crash #8638

Merged
merged 4 commits into from
Jan 2, 2024
Merged

Conversation

windtalker
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #8633

Problem Summary:

What is changed and how it works?

The root cause is in Join::finalize, it may add some REMOVE_COLUMN action in other_cond_expr if it is not semi or nullaware join:

non_equal_conditions.other_cond_expr->finalize(updated_require, keep_used_input_columns);

however, for function handleOtherCondition(),
void Join::handleOtherConditions(
Block & block,
IColumn::Filter * anti_filter,
IColumn::Offsets * offsets_to_replicate,
const std::vector<size_t> & right_table_columns) const

right_table_columns is a index based on previous block, of there is REMOVE_COLUMN action in other_cond_expr, the index will become invalid.

This pr disable generating REMOVE_COLUMN during Join::finalize. It is possible that refine the code in handleOtherCondition so it does not depends on the index based right_table_columns, but I would like to do it in a standalone pr later since there is no too much time before a new release.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 2, 2024
Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

lgtm

dbms/src/Interpreters/Join.cpp Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 2, 2024
Signed-off-by: xufei <[email protected]>
Signed-off-by: xufei <[email protected]>
@windtalker windtalker force-pushed the fix_hash_join_crash branch from e4ce63a to d9ca6cd Compare January 2, 2024 08:46
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 2, 2024
Copy link
Contributor

ti-chi-bot bot commented Jan 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SeaRise, yibin87

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 2, 2024
Copy link
Contributor

ti-chi-bot bot commented Jan 2, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-02 07:57:49.378008217 +0000 UTC m=+2157360.415235142: ☑️ agreed by SeaRise.
  • 2024-01-02 08:47:17.411255277 +0000 UTC m=+2160328.448482204: ☑️ agreed by yibin87.

Copy link
Contributor

ti-chi-bot bot commented Jan 2, 2024

@windtalker: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@windtalker
Copy link
Contributor Author

/rebuild

@windtalker
Copy link
Contributor Author

/run-all-tests

1 similar comment
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot merged commit 4730c66 into pingcap:master Jan 2, 2024
6 checks passed
@windtalker windtalker deleted the fix_hash_join_crash branch January 3, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash crash in HashJoin
4 participants