Skip to content

HBASE-30327 Implement adaptive parallel seek in StoreScanner - #8566

Open
ichsansaid wants to merge 1 commit into
apache:masterfrom
ichsansaid:HBASE-30327-adaptive-parallel-seek
Open

HBASE-30327 Implement adaptive parallel seek in StoreScanner#8566
ichsansaid wants to merge 1 commit into
apache:masterfrom
ichsansaid:HBASE-30327-adaptive-parallel-seek

Conversation

@ichsansaid

Copy link
Copy Markdown

Summary

Introduces an adaptive parallel seek strategy in StoreScanner that gracefully handles thread pool saturation by dynamically switching between parallel and sequential execution based on available capacity.

JIRA: https://issues.apache.org/jira/browse/HBASE-30327

Problem

When parallel seek is enabled, all StoreFileScanner seek operations are submitted to the RS_PARALLEL_SEEK thread pool with an unbounded queue. Under high concurrency, this can lead to:

  • Queue buildup while scanner threads wait for their tasks
  • Increased latency from blocking on full queues
  • Thread starvation

Solution

Adaptive parallel seek checks pool capacity before submission using a conservative approach (queue.isEmpty() && activeCount < poolSize). When the pool is saturated:

  • Falls back to sequential seek on the calling thread
  • Re-checks capacity after each sequential seek
  • Opportunistically parallelizes when slots become available

Changes

  • Add private getAvailableParallelSeekCapacity() in StoreScanner (keeps change local)
  • Add adaptiveParallelSeek() method with proper error handling:
    • Inline seek IOException waits for submitted handlers before propagating
    • Uses direct scanner.seek() for inline path (not ParallelSeekHandler)
    • Capacity counted for StoreFileScanners only
  • Add configuration hbase.storescanner.adaptive.parallel.seek.enable (default: false)
  • Add adaptiveParallelSeekEnabled field to ScanInfo

Configuration

Property Default Description
hbase.storescanner.adaptive.parallel.seek.enable false Enable adaptive parallel seek (requires parallel.seek.enable=true)

Testing

  • Unit tests for adaptive behavior (sequential fallback, mixed mode, error propagation)
  • Existing parallel seek tests unaffected

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