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

executor: Fix compact for VARCHAR PK #51812

Merged
merged 1 commit into from Mar 15, 2024

Conversation

breezewish
Copy link
Member

@breezewish breezewish commented Mar 15, 2024

What problem does this PR solve?

Issue Number: Fix #51810

Problem Summary:

What changed and how does it work?

When returning the Start key and End key to TiDB, TiFlash does not encode them in a memory comparable way, so that we cannot simply compare these keys.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix `ALTER TABLE ... COMPACT` may not work for tables with a VARCHAR primary key

Signed-off-by: Wish <breezewish@outlook.com>
@ti-chi-bot ti-chi-bot bot added release-note size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 15, 2024
Copy link
Contributor

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

ti-chi-bot bot commented Mar 15, 2024

@JaySon-Huang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

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 kubernetes/test-infra repository.

@JaySon-Huang
Copy link
Contributor

TiFlash does not encode them in a memory comparable way

TiFlash encodes the rowkey with

  • a bool to indicate whether it is a common handle
  • a varchar to indicate the length of rowkey
  • the rowkey

Code: https://github.com/pingcap/tiflash/blob/0d13f398b566c7b06303747b117c3d3af0e5c779/dbms/src/Storages/DeltaMerge/RowKeyRange.h#L238-L242

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Merging #51812 (c400020) into master (1bac1d4) will increase coverage by 3.5474%.
Report is 1 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51812        +/-   ##
================================================
+ Coverage   69.2410%   72.7884%   +3.5474%     
================================================
  Files          1476       1476                
  Lines        418158     438083     +19925     
================================================
+ Hits         289537     318874     +29337     
+ Misses       109142      99127     -10015     
- Partials      19479      20082       +603     
Flag Coverage Δ
integration 48.8212% <0.0000%> (?)
unit 70.4749% <0.0000%> (+1.4711%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 51.4834% <ø> (+5.0781%) ⬆️

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

ti-chi-bot bot commented Mar 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-15 06:16:50.332096786 +0000 UTC m=+1011837.354343175: ☑️ agreed by crazycs520.
  • 2024-03-15 06:23:40.974120812 +0000 UTC m=+1012247.996367197: ☑️ agreed by windtalker.

@breezewish
Copy link
Member Author

/merge

Copy link

ti-chi-bot bot commented Mar 15, 2024

@breezewish: We have migrated to builtin LGTM and approve plugins for reviewing.

Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

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.

@breezewish
Copy link
Member Author

/test unit-test

Copy link

tiprow bot commented Mar 15, 2024

@breezewish: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test unit-test

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 kubernetes/test-infra repository.

@breezewish
Copy link
Member Author

/approve

Copy link

ti-chi-bot bot commented Mar 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: breezewish, crazycs520, JaySon-Huang, 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 [breezewish,crazycs520,windtalker]

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

@breezewish
Copy link
Member Author

/merge

Copy link

ti-chi-bot bot commented Mar 15, 2024

@breezewish: We have migrated to builtin LGTM and approve plugins for reviewing.

Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

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.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #51817.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #51818.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #51819.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #51820.

@breezewish breezewish deleted the wenxuan/compact_fix branch March 16, 2024 02:38
ti-chi-bot bot pushed a commit that referenced this pull request Mar 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 15, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ALTER TABLE ... COMPACT may not work for clustered key
5 participants