Limit REST write request size on dev/1.3 - #18461
Draft
HTHou wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev/1.3 #18461 +/- ##
=============================================
+ Coverage 44.46% 44.55% +0.09%
Complexity 198 198
=============================================
Files 3641 3646 +5
Lines 246603 246865 +262
Branches 30284 30326 +42
=============================================
+ Hits 109654 109999 +345
+ Misses 136949 136866 -83 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport the REST write request resource limits from #17481 to
dev/1.3.A crafted
insertTabletorinsertRecordsrequest can contain an extremely large JSON body or a very large number of rows, columns, and values. Before this change, the REST layer deserialized and processed the payload without a bounded request-body or aggregate memory budget, which could exhaust DataNode heap under concurrent requests.This change:
Content-Lengthby counting bytes while the entity stream is read;New configuration parameters:
rest_max_request_body_size_in_bytes=16777216rest_max_total_concurrent_request_body_size_in_bytes=0rest_max_insert_rows=100000rest_max_insert_columns=1024rest_max_insert_values=1000000For
rest_max_total_concurrent_request_body_size_in_bytes,0uses half of the free-memory share configured bydatanode_memory_proportion(5% of maximum heap with the default ratio), matching the budget used by the newer branch's auto-resizing buffer memory control. Negative values disable the corresponding limit.Compatibility
The
dev/1.3REST implementation is part of the DataNode module and supports tree-model REST v1/v2 only. This backport therefore adapts the fix tojavax.ws.rsand Java 8 and does not include the newer table-model REST endpoints.Tests
14 tests passed with no failures or errors.