Skip to content

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction#9945

Merged
ti-chi-bot[bot] merged 6 commits intopingcap:masterfrom
JaySon-Huang:fix_local_index_not_removed
Mar 6, 2025
Merged

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction#9945
ti-chi-bot[bot] merged 6 commits intopingcap:masterfrom
JaySon-Huang:fix_local_index_not_removed

Conversation

@JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Mar 5, 2025

What problem does this PR solve?

Issue Number: close #9946

Problem Summary:

Some pages for local index in the ColumnFileTiny is not removed when doing MinorCompaction

wbs.removed_log.delPage(t_file->getDataPageId());

In MinorCompaction::prepare we use wbs.removed_log.delPage(t_file->getDataPageId()); to remove the ColumnFileTiny. But this will not remove the related LocalIndex page_id with the ColumnFileTiny. We must use t_file->removeData(wbs); to remove the ColumnFileTiny along with its LocalIndex page_ids.

BTW, SegmentSplit, SegmentMerge and SegmentDeltaMerge (MajorCompaction) calls DeltaValueSpace::recordRemoveColumnFilesPages and can correctly remove the LocalIndex page_ids.

What is changed and how it works?

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction
Add test cases about the removing page_id when doing MinorCompaction
Add test cases about querying the ColumnFileTiny in DeltaVS with VectorIndex could filter the return rows

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 the bug that some data may not be able to be removed after user inserted rows into a table with vector index

Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue 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. 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 Mar 5, 2025
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@breezewish
Copy link
Member

Curious how did you find this issue?

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 6, 2025
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 6, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-06 00:51:02.764092856 +0000 UTC m=+489175.893012592: ☑️ agreed by JinheLin.
  • 2025-03-06 02:18:59.063141162 +0000 UTC m=+494452.192060908: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot merged commit cbf37d0 into pingcap:master Mar 6, 2025
5 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_local_index_not_removed branch March 6, 2025 02:34
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Mar 6, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Mar 6, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #9951.
But this PR has conflicts, please resolve them!

@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Mar 27, 2025
JaySon-Huang added a commit to ti-chi-bot/tiflash that referenced this pull request Mar 31, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Mar 31, 2025
…ing MinorCompaction (#9945) (#9951)

close #9946

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction
Add test cases about the removing page_id when doing MinorCompaction
Add test cases about querying the ColumnFileTiny in DeltaVS with VectorIndex could filter the return rows

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: JaySon-Huang <tshent@qq.com>

Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon-Huang <tshent@qq.com>
yongman pushed a commit to yongman/tiflash that referenced this pull request Jun 18, 2025
…ing MinorCompaction (pingcap#9945)

close pingcap#9946

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction
Add test cases about the removing page_id when doing MinorCompaction
Add test cases about querying the ColumnFileTiny in DeltaVS with VectorIndex could filter the return rows

Signed-off-by: JaySon-Huang <tshent@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Some pages for local index in the ColumnFileTiny is not removed when doing MinorCompaction

5 participants