Skip to content

fix virtual column not found when remote read happens (#9920)#9923

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:release-6.1from
ti-chi-bot:cherry-pick-9920-to-release-6.1
Mar 3, 2025
Merged

fix virtual column not found when remote read happens (#9920)#9923
ti-chi-bot[bot] merged 4 commits intopingcap:release-6.1from
ti-chi-bot:cherry-pick-9920-to-release-6.1

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #9920

What problem does this PR solve?

Issue Number: close #9561

Problem Summary:

select col, gen_col from t;

gen_col is a virtual generated column. The current approach is that TiFlash generates an empty column and places it in the block. Then, it passes the block to TiDB, allowing TiDB to calculate and populate the column.

I’ve named this column generated_xxx.

The information about this column is marked in tipb_table_scan.columns with a flag. When TiFlash sees this flag, it automatically adds a generated_xxx column.

However, this situation has an issue when a remote read occurs: the block returned from the remote read, when parsed, assigns names to each column based on RemoteRequest.schema. For example, if TiFlash-1 receives a block from TiFlash-2, it will parse it as <col, gen_col>.

But TiFlash-1, in the table scan's projection, expects the block to be <col, generated_xxx>. So, when projecting the block from the remote read, an error occurs because it cannot find the generated_xxx column.

What is changed and how it works?

make the column name of local read and remote read be same


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

fix virtual column not found when remote read happens

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels Feb 27, 2025
@ti-chi-bot
Copy link
Member Author

@guo-shaoge This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Feb 27, 2025
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 27, 2025
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

@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 27, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: solotzg, windtalker

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

The pull request process is described here

Details 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 Feb 27, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 27, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-27 09:23:01.141446958 +0000 UTC m=+520529.094605224: ☑️ agreed by solotzg.
  • 2025-02-27 09:27:21.394205455 +0000 UTC m=+520789.347363733: ☑️ agreed by windtalker.

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 28, 2025
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot merged commit 0a9f5fd into pingcap:release-6.1 Mar 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants