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

vector: Fix ColumnArray does not work well with CHBlockChunkCodec #9477

Merged

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Sep 27, 2024

What problem does this PR solve?

Issue Number: close #9485

Problem Summary:

When MPP tasks exchange data with type Array(Float32), CHBlockChunkDecodeAndSquash will try to merged the deserialized data into a larger block. But CHBlockChunkCodec and CHBlockChunkDecodeAndSquash seri/deseri the array data with position_independent_encoding == false, which cause the column_array.offsets store incorrect data and causes invalid memory access.

What is changed and how it works?

vector: Fix ColumnArray does not work well with CHBlockChunkCodec
  • Set position_independent_encoding == true in CHBlockChunkCodec and CHBlockChunkDecodeAndSquash. So that the array data can be correctly serialized and deserialized
  • Add check for DataTypeArray::deserializeBinaryBulkWithMultipleStreams. If the function is called with position_independent_encoding == false, and try to deserialize data into a non-empty column, throw an exception

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 27, 2024
@JaySon-Huang JaySon-Huang changed the title vector: Fix ColumnArray does not work well with CHBlockChunkCodec [WIP] vector: Fix ColumnArray does not work well with CHBlockChunkCodec Sep 27, 2024
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 27, 2024
@JaySon-Huang JaySon-Huang changed the title [WIP] vector: Fix ColumnArray does not work well with CHBlockChunkCodec vector: Fix ColumnArray does not work well with CHBlockChunkCodec Sep 27, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 27, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-27 08:44:28.812306988 +0000 UTC m=+1814738.552730936: ☑️ agreed by JinheLin.
  • 2024-09-27 08:53:02.273177 +0000 UTC m=+1815252.013600951: ☑️ agreed by Lloyd-Pottiger.

Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2024

@JaySon-Huang: 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.

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JinheLin, Lloyd-Pottiger, windtalker

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:
  • OWNERS [JinheLin,Lloyd-Pottiger,windtalker]

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 merged commit bfb8ca9 into pingcap:feature/vector-index Sep 27, 2024
5 of 7 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_exchange_vec_crash branch September 27, 2024 09:57
@JaySon-Huang JaySon-Huang linked an issue Sep 27, 2024 that may be closed by this pull request
@JaySon-Huang JaySon-Huang mentioned this pull request Sep 30, 2024
12 tasks
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Oct 14, 2024
…ngcap#9477)

close pingcap#9485

vector: Fix ColumnArray does not work well with CHBlockChunkCodec

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tiflash crash when executing queries group by vector type
4 participants