Skip to content

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

@JaySon-Huang

Description

@JaySon-Huang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/storageseverity/moderatetype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions