native memory based admission control - #21191
Conversation
PR Reviewer Guide 🔍(Review updated until commit 50e9d44)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 50e9d44 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit f740729
Suggestions up to commit 2d34120
Suggestions up to commit b89cd50
Suggestions up to commit 1b68af3
Suggestions up to commit a12c25b
|
|
❌ Gradle check result for 17de515: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 1e8ec5a |
|
Persistent review updated to latest commit 99e846e |
|
❌ Gradle check result for 99e846e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit cf12505 |
|
❌ Gradle check result for cf12505: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 76c4daf |
|
❌ Gradle check result for 76c4daf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
76c4daf to
091d5dc
Compare
|
Persistent review updated to latest commit 2d34120 |
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Replace the datafusion/parquet-derived cap in AverageNativeMemoryUsageTracker with two explicit node-scope dynamic settings: node.native_memory.limit (ByteSizeValue, default 0b) node.native_memory.buffer_percent (int 0-99, default 0) The tracker now divides observed native-memory use (max(0, RssAnon - HeapCommitted)) by limit - (limit * bufferPercent / 100). When the limit is unset or the buffer fully consumes it, getUsage() returns 0 without dividing. Also: allow read access to /proc/self/status in the Java security policy and systemd unit so OsProbe.getProcessRssAnon() works in hardened installs. Signed-off-by: Pradeep L <spradeel@amazon.com>
…ynamic update fix Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
Signed-off-by: Pradeep L <spradeel@amazon.com>
2d34120 to
f740729
Compare
|
Persistent review updated to latest commit f740729 |
|
❌ Gradle check result for f740729: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 50e9d44 |
Builds on opensearch-project#21703 with the framework-side changes that were not part of its initial scope. Consumer wiring for arrow-flight-rpc and analytics-engine is handled by opensearch-project#21465 (arrow-base, already merged) and not duplicated here. Pools added: POOL_QUERY analytics-engine query execution POOL_DATAFUSION DataFusion native MemoryPool mirror Both registered with min/max settings dynamically updatable. The flight and ingest pools registered by opensearch-project#21703 are unchanged. Cross-cutting changes: * NativeAllocatorListener SPI in arrow-spi for pool-resize callbacks (allocator-agnostic, no Arrow types in the signature). DataFusion uses this to mirror datafusion-pool resize to the Rust MemoryPool via df_set_memory_pool_limit (R1). * Derive native.allocator.root.limit from node.native_memory.limit * 0.8 when unset, leaving 20% headroom for non-Arrow native usage that admission control still needs to throttle on (R5). Reconciles with opensearch-project#21191's admission control. * Implement CircuitBreakerPlugin: register a native_arrow breaker with Durability.PERMANENT so root usage is reflected in _nodes/stats?breaker and the parent breaker rolls up off-heap pressure. Allocator periodically syncs root.getAllocatedMemory into the breaker counter via the rebalance hook. * Probe df_set_spill_limit at NativeBridge static init. When the symbol is present, datafusion.spill_memory_limit_bytes becomes Dynamic and a listener calls the FFM symbol on resize. When absent, the setting stays NodeScope-only and OpenSearch rejects runtime PUTs cleanly. Lights up automatically once the upstream datafusion crate carrying df_set_spill_limit is picked up here. * Delete dead DataFusionService.rootAllocator field and newChildAllocator() method (no production callers). * Call rebalance() once after pool creation in createComponents so pools reach their max capacity even when the rebalancer is disabled by default. Without this, pools sit at min=0 and silently fail allocations. * Add ensureForTesting helper for unit tests that bring up consumers without the plugin lifecycle. Tests cover listener fan-out, multi-listener invocation, exception isolation, breaker sync via rebalance, AC-derived default resolution. Signed-off-by: Gaurav Singh <gauravsg@amazon.com>
…1191) Implement Native memory based admission control Signed-off-by: Pradeep L <spradeel@amazon.com>
Description
This change introduces a Native Memory Based Admission Controller that throttles incoming transport requests (search, indexing, cluster admin) based on actual physical memory utilization on the node. The controller reads native memory usage from OsProbe. which parses MemAvailable from /proc/meminfo on Linux systems. The NativeMemoryBasedAdmissionController evaluates this usage against configurable per-action-type thresholds and rejects the requests with HTTP 429 . This gives the operators a more accurate signal for memory pressure since it accounts for OS-level page cache and slab memory rather than relying solely on JVM heap usage.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.