Skip to content

HBASE-30398 Support configuring the concurrency of off-peak compactions - #8669

Open
Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-27861
Open

Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-27861

Conversation

@Huginn-kio

@Huginn-kio Huginn-kio commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

HBASE-30398

HBASE-30398 tracks the issue described below.

Summary

HBase currently allows only one off-peak compaction at a time within a RegionServer. This is
enforced by a single AtomicBoolean shared by all stores, so compaction capacity is underutilized
on systems with enough resources.

Root cause

HStore uses one AtomicBoolean for off-peak compaction admission. A store can enter the off-peak
path only when it changes the flag from false to true; the flag is cleared after selection
fails or the compaction finishes. As a result, all stores contend for one permit.

Fix

  • Replace the single boolean gate with a shared semaphore-backed tracker.
  • Add hbase.hstore.offpeak.compaction.concurrency, defaulting to 1, to control the number of
    concurrent off-peak compactions.
  • Register the tracker with configuration observers so the permit count follows runtime
    configuration changes.
  • Add unit coverage for the configured concurrency and updates to the setting.

Testing

  • mvn -pl hbase-server -am -Dtest=TestOffPeakCompactionTracker -Dsurefire.failIfNoSpecifiedTests=false -DskipITs test
  • mvn -pl hbase-server -am -Dtest=TestOffPeakCompactionTracker,TestOffPeakHours,TestCurrentHourProvider,TestCloseChecker -Dsurefire.failIfNoSpecifiedTests=false -DskipITs test
  • mvn -pl hbase-server -am -DskipTests package
  • mvn -pl hbase-server -DskipTests checkstyle:check -Dcheckstyle.includes='**/OffPeakCompactionTracker.java,**/TestOffPeakCompactionTracker.java'
  • mvn -pl hbase-server -DskipTests apache-rat:check spotbugs:check

The focused tests passed with 2 tests and the adjacent regression slice passed with 7 tests.

Compatibility

The setting is optional and defaults to 1, preserving the current behavior. This change does not
alter public APIs, wire formats, or persisted state.

@Huginn-kio Huginn-kio changed the title HBASE-27861 Support configuring the concurrency of off-peak compactions HBASE-30398 Support configuring the concurrency of off-peak compactions Sep 16, 2026
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.

1 participant