feat support to set exclusive_manual_compaction when running compaction #6126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Fixes #6124
Description:
Currently, NebulaGraph doesn't support configuring RocksDB's
exclusive_manual_compactionparameter. In production environments, when performing manual compaction to clean up expired historical data, users encounter the following pain points:Core pain point: Users need to perform manual compaction to clean up expired data while maintaining normal automatic compaction to prevent write performance degradation. Currently, these two requirements cannot be satisfied simultaneously.
How do you solve it?
This PR solves the above problems by adding support for RocksDB's
exclusive_manual_compactionparameter:1. New Configuration Parameter
Added a new gflag configuration:
FLAGS_rocksdb_compact_exclusive_manual_compactionbooltrue(maintains backward compatibility and existing behavior)2. Code Changes Details
File:
src/kvstore/RocksEngineConfig.hFile:
src/kvstore/RocksEngineConfig.cppFile:
src/kvstore/RocksEngine.cppApplied the parameter in the
compact()method:3. Configuration Methods
Users can configure this parameter in Configuration File:
Special notes for your reviewer, ex. impact of this fix, design document, etc:
Design Considerations
true, fully maintains existing behavior, no impact on any existing deploymentsImpact Analysis
Positive Impact:
Risk Assessment:
false, manual compaction may be slightly slower, but prevents write performance degradationTechnical Details
RocksDB Behavior:
exclusive_manual_compaction = true(default): Manual compaction monopolizes all compaction resources, other compactions are blockedexclusive_manual_compaction = false: Manual compaction and automatic compaction can execute concurrentlyTesting Recommendations
Functional Testing:
true) is consistent with previous versionsfalse, manual and automatic compaction can run concurrentlyPerformance Testing:
Stress Testing:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe:
Feature Enhancement: Added support for RocksDB's
exclusive_manual_compactionparameter. Through the newrocksdb_compact_exclusive_manual_compactionconfiguration option, users can control whether manual compaction blocks automatic compaction.Key Features:
rocksdb_compact_exclusive_manual_compaction(default:true)false, manual compaction and automatic compaction can execute concurrently, preventing write performance degradation caused by SST file accumulation during long-running manual compactionApplicable Scenarios: