You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[opt] Prevent Load starvation by reserving buffers for high-priority operations (#895)
## Purpose
This PR introduces a reserved buffer mechanism to prevent Load
operations from being starved when Dump operations consume all available
buffers slowly.
In scenarios where Dump operations process buffers slowly, they can
occupy all buffers, causing Load operations to wait indefinitely. By
reserving a portion of buffers exclusively for Load operations, we
ensure system responsiveness and prevent deadlocks.
## Modifications
- Added loadExclusiveBufferNumber configuration parameter (default 1024)
to specify the number of buffers reserved for Load operations.
- Modified buffer allocation logic to respect reserved buffers: ordinary
allocations cannot use the last loadExclusiveBufferNumber buffers, while
Load operations (with allowReserved=true) can access all buffers.
- Updated LoadQueue::DispatchOneTask to request buffers with
allowReserved=true to ensure Load tasks can always get buffers.
- Added comprehensive tests for reserved buffer behavior.
## Test
- Added GetReservedNode test to verify reserved buffer allocation logic.
- Existing tests pass with updated configurations.
## Configuration
New config parameter: `cache_load_exclusive_buffer_number` (default:
1024)
0 commit comments