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

ignore delmark when add minmax for pk column #4746

Merged
merged 3 commits into from
Apr 25, 2022

Conversation

lidezhu
Copy link
Contributor

@lidezhu lidezhu commented Apr 25, 2022

What problem does this PR solve?

Issue Number: close #4747

Problem Summary:
If rows in a stable pack is all mark deleted, then it's minmax index for pk column is both 0.
And when dt_enable_skippable_place is enabled and try to place delta index on this segment, it will filter out all pack which is not in the pk range [start_key, +infinite). So the previous stable pack is ignored.
But for the place delta index algorithm, it's expected that all the rows in the pk range [start_key, +infinite) is placed no matter whether it's deleted. So when we try to read this segment using the placed delta index, it reports error like "DeltaMerge return wrong result"

What is changed and how it works?

Ignore delmark when add minmax for pk column.

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 potential query error when select on a table with many delete operations

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Apr 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • flowbehappy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue 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 Apr 25, 2022
@lidezhu lidezhu force-pushed the fix-skippable-place branch from 39127b9 to 85b237c Compare April 25, 2022 01:55
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 needs-cherry-pick-release-5.2 PR which needs to be cherry-picked to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.0 Type: Need cherry pick to release-6.0 release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Apr 25, 2022
@lidezhu
Copy link
Contributor Author

lidezhu commented Apr 25, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Apr 25, 2022

Coverage for changed files

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File/DMFileWriter.cpp              109                 7    93.58%          15                 0   100.00%         446                17    96.19%          74                 8    89.19%
tests/dm_basic_include.h           154                 9    94.16%          15                 1    93.33%         226                24    89.38%          76                15    80.26%
tests/gtest_dm_segment.cpp        3406               865    74.60%          38                 1    97.37%        1497                40    97.33%        1130               482    57.35%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             3669               881    75.99%          68                 2    97.06%        2169                81    96.27%        1280               505    60.55%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17133      9492             44.60%    192879  96260        50.09%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 25, 2022
@flowbehappy flowbehappy removed the needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 label Apr 25, 2022
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 label Apr 25, 2022
@lidezhu lidezhu removed the needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 label Apr 25, 2022
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

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 25, 2022
@lidezhu lidezhu deleted the fix-skippable-place branch April 25, 2022 08:47
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 25, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4756.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 25, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4757.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 25, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4758.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4759.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4760.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4761.

lidezhu added a commit that referenced this pull request Apr 26, 2022
* ignore delmark when add minmax for pk column

* remove extra line

* fix static analysis

Co-authored-by: lidezhu <[email protected]>
Co-authored-by: lidezhu <[email protected]>
lidezhu added a commit to lidezhu/tics that referenced this pull request May 23, 2022
lidezhu added a commit to lidezhu/tics that referenced this pull request May 23, 2022
lidezhu added a commit that referenced this pull request May 23, 2022
* ignore delmark when add minmax for pk column (#4746)

close #4747

* fix static analysis

* use release-5.4 branch image for other components

* fix fullstack image
lidezhu added a commit to lidezhu/tics that referenced this pull request May 31, 2022
lidezhu added a commit to lidezhu/tics that referenced this pull request May 31, 2022
…4963)

* ignore delmark when add minmax for pk column (pingcap#4746)

close pingcap#4747

* fix static analysis

* use release-5.4 branch image for other components

* fix fullstack image
@lidezhu lidezhu mentioned this pull request Jun 14, 2022
12 tasks
lidezhu added a commit that referenced this pull request Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 needs-cherry-pick-release-5.2 PR which needs to be cherry-picked to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.0 Type: Need cherry pick to release-6.0 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeltaMerge return wrong result
5 participants