-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][broker] Fix broker OOM when upload a large package. #22989
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22989 +/- ##
============================================
- Coverage 73.57% 73.43% -0.15%
- Complexity 32624 33266 +642
============================================
Files 1877 1907 +30
Lines 139502 142951 +3449
Branches 15299 15578 +279
============================================
+ Hits 102638 104972 +2334
- Misses 28908 29946 +1038
- Partials 7956 8033 +77
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Catch!
...e/src/main/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStream.java
Outdated
Show resolved
Hide resolved
(cherry picked from commit da2a191)
(cherry picked from commit da2a191)
(cherry picked from commit da2a191)
(cherry picked from commit da2a191) Signed-off-by: Zixuan Liu <[email protected]>
Motivation
Using package API to upload a large package may cause broker OOM.
Because in the current implementation, will copy all data to the heap.
pulsar/pulsar-package-management/bookkeeper-storage/src/main/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStream.java
Lines 60 to 65 in 2c6fcc7
Modifications
Each time, only copy the size of one record and then upload it directly.
There is no need to worry about batching, as the
distributedlog client
will handle the batching.Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: