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

The gcTrySegmentMergeDelta on common handle table can not GC data correctly in timely manner #9529

Closed
JaySon-Huang opened this issue Oct 15, 2024 · 0 comments · Fixed by #9530
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/storage severity/moderate type/bug The issue is confirmed as a bug.

Comments

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Oct 15, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

we get the "suqash delete range" to estimate whether there are sufficient delete rows that we need to compact data in background thread.

auto actual_delete_range = snap->delta->getSquashDeleteRange().shrink(segment_range);
if (actual_delete_range.none())
return false;

In ColumnFileSetSnapshot::getSquashDeleteRange, it use the member variable is_common_handle, rowkey_column_size to generate the rowkey range.
But actually those two variable are not set correctly. is_common_handle is always false in ColumnFileSetSnapshot

RowKeyRange ColumnFileSetSnapshot::getSquashDeleteRange() const
{
RowKeyRange squashed_delete_range = RowKeyRange::newNone(is_common_handle, rowkey_column_size);
for (const auto & column_file : column_files)
{
if (auto * f_delete = column_file->tryToDeleteRange(); f_delete)
squashed_delete_range = squashed_delete_range.merge(f_delete->getDeleteRange());
}
return squashed_delete_range;
}

So when the table use common-handle, shouldCompactDeltaWithStable always returns false, and the segment background gc is not GC in timely

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

master

@JaySon-Huang JaySon-Huang added the type/bug The issue is confirmed as a bug. label Oct 15, 2024
@JaySon-Huang JaySon-Huang added severity/moderate component/storage affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Oct 15, 2024
ti-chi-bot bot pushed a commit that referenced this issue Oct 15, 2024
…d key-range when using common-handle (#9530)

close #9529

Storage: Fix `getSquashDeleteRange` does not return correctly squashed key-range when using common-handle
ti-chi-bot bot pushed a commit that referenced this issue Nov 1, 2024
…d key-range when using common-handle (#9530) (#9565)

close #9529

Storage: Fix `getSquashDeleteRange` does not return correctly squashed key-range when using common-handle

Co-authored-by: JaySon <[email protected]>
Co-authored-by: JaySon-Huang <[email protected]>
ti-chi-bot bot pushed a commit that referenced this issue Nov 21, 2024
…d key-range when using common-handle (#9530) (#9541)

close #9529

Storage: Fix `getSquashDeleteRange` does not return correctly squashed key-range when using common-handle

Co-authored-by: JaySon-Huang <[email protected]>
Co-authored-by: JaySon <[email protected]>
ti-chi-bot bot added a commit that referenced this issue Nov 21, 2024
…d key-range when using common-handle (#9530) (#9542)

close #9529

Storage: Fix `getSquashDeleteRange` does not return correctly squashed key-range when using common-handle

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>

Co-authored-by: JaySon <[email protected]>
Co-authored-by: JaySon-Huang <[email protected]>
Co-authored-by: Lloyd-Pottiger <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/storage severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
1 participant