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

Add column family parameter to Compact methon #1878

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Add column family parameter to Compact methon #1878

merged 1 commit into from
Nov 6, 2023

Conversation

raffertyyu
Copy link
Contributor

fix issue #1864
Added a parampeter to specify the column family that should be compacted.
If cf is nullptr, it means all CFs should be compacted.

This patch also fixed a calculation bug I found in compaction_checker.cc

auto force_compact_min_ratio =
    static_cast<double>(storage_->GetConfig()->force_compact_file_min_deleted_percentage / 100);

The force_compact_file_min_deleted_percentage is an interger and must be between 1 and 100. So the force_compact_min_ratio result is always either 0.0 or 1.0.

Copy link

sonarqubecloud bot commented Nov 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

Good catch, LGTM.

@git-hulk git-hulk requested a review from PragmaTwice November 6, 2023 01:26
@git-hulk git-hulk merged commit 0ea85d4 into apache:unstable Nov 6, 2023
@raffertyyu raffertyyu deleted the fixCompact branch November 6, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants