Skip to content

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

Merged
ti-chi-bot[bot] merged 3 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-9945-to-release-8.5
Mar 31, 2025
Merged

vector: Fix the bug that the local index in CFTiny is not removed during MinorCompaction (#9945)#9951
ti-chi-bot[bot] merged 3 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-9945-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #9945

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

@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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Mar 6, 2025
@ti-chi-bot
Copy link
Member Author

@JaySon-Huang 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 Mar 28, 2025
@JaySon-Huang
Copy link
Contributor

/hold cancel

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2025
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 28, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 28, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, 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 [JaySon-Huang,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 28, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 28, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-28 04:35:40.486411796 +0000 UTC m=+1194234.170647892: ☑️ agreed by JaySon-Huang.
  • 2025-03-28 05:12:45.433979538 +0000 UTC m=+1196459.118215631: ☑️ agreed by Lloyd-Pottiger.

@JaySon-Huang JaySon-Huang force-pushed the cherry-pick-9945-to-release-8.5 branch from 75d1a0f to da55ae4 Compare March 31, 2025 06:59
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 31, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang JaySon-Huang force-pushed the cherry-pick-9945-to-release-8.5 branch from da55ae4 to 3410adf Compare March 31, 2025 07:00
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 31, 2025
@ti-chi-bot ti-chi-bot bot merged commit abad4bb into pingcap:release-8.5 Mar 31, 2025
4 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants