Skip to content

[Bug][Compaction] Fix bug that output rowset is not deleted after compaction failure. - #4964

Merged
morningman merged 1 commit into
apache:masterfrom
morningman:compaction_gc_bug
Nov 30, 2020
Merged

[Bug][Compaction] Fix bug that output rowset is not deleted after compaction failure.#4964
morningman merged 1 commit into
apache:masterfrom
morningman:compaction_gc_bug

Conversation

@morningman

@morningmanmorningman commented Nov 26, 2020

Copy link
Copy Markdown
Contributor

Proposed changes

This CL fix 2 bugs:

When the compaction fails, we must explicitly delete the output rowset,
otherwise the GC logic cannot process these rows.

Base compaction failed if compaction process include some delete version in SegmentV2,
Because the number of filtered rows is wrong.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

@morningmanmorningman added kind/fix Categorizes issue or PR as related to a bug. area/compact Issues or PRs related to the compact labels Nov 26, 2020
@morningmanmorningman self-assigned this Nov 26, 2020
Comment threadbe/src/olap/reader.h Outdated
}

uint64_t filtered_rows() const {
return _stats.rows_del_filtered;

@xy720xy720Nov 26, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, is it compatible with segment v1?
In alpha_rowset_reader.h, filtered_rows() only calculates rows_del_filtered.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is compatible. Because rows_conditions_filtered is only used for SegmentV2, so it should always to 0 in Segment V1.

@xy720xy720 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

yangzhg
yangzhg previously approved these changes Nov 27, 2020

@yangzhgyangzhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@yangzhgyangzhg added the approved Indicates a PR has been approved by one committer. label Nov 27, 2020
Comment threadbe/src/olap/compaction.cpp
chaoyli
chaoyli previously approved these changes Nov 30, 2020

@yangzhgyangzhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@morningman
morningman merged commit 99404df into apache:masterNov 30, 2020
@yangzhgyangzhg mentioned this pull request Feb 9, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.area/compactIssues or PRs related to the compactkind/fixCategorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Compaction] The data files are not deleted after compaction failed.

5 participants

@morningman@yangzhg@xy720@chaoyli@morningman-cmy