ichsansaid opened a new pull request, #8566: URL: https://github.com/apache/hbase/pull/8566
## 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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
