-
Notifications
You must be signed in to change notification settings - Fork 395
[AMORO-4166] [Improvement]: Implement heap-based flush mechanism for SortedPosDeleteWriter to prevent OOM. #4276
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
base: master
Are you sure you want to change the base?
Changes from all commits
6ea6538
6d2213c
ff60a38
c93ec23
b877434
dde0a77
9449c79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,6 +300,16 @@ private TableProperties() {} | |
| org.apache.iceberg.TableProperties.WRITE_TARGET_FILE_SIZE_BYTES; | ||
| public static final long WRITE_TARGET_FILE_SIZE_BYTES_DEFAULT = 134217728; // 128 MB | ||
|
|
||
| public static final String POS_DELETE_FLUSH_HEAP_RATIO = "pos-delete.flush.heap.ratio"; | ||
| public static final double POS_DELETE_FLUSH_HEAP_RATIO_DEFAULT = 0.8d; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (blocking) Since |
||
|
|
||
| public static final String POS_DELETE_FLUSH_RECORDS = "pos-delete.flush.records"; | ||
| public static final long POS_DELETE_FLUSH_RECORDS_DEFAULT = Long.MAX_VALUE; | ||
|
|
||
| public static final String POS_DELETE_FLUSH_HEAP_MIN_RECORDS = | ||
| "pos-delete.flush.heap.min-records"; | ||
| public static final int POS_DELETE_FLUSH_HEAP_MIN_RECORDS_DEFAULT = 1000; | ||
|
|
||
| public static final String UPSERT_ENABLED = "write.upsert.enabled"; | ||
| public static final boolean UPSERT_ENABLED_DEFAULT = false; | ||
|
|
||
|
|
||
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.
(blocking)
totalMemory() - freeMemory()counts garbage that has not been collected yet, and it is a JVM-wide number shared by every rewrite task running in the optimizer. With G1 the heap routinely sits above 80% between collections even when live data is small, so this writer would flush every 1,000 records regardless of how much it actually buffers, and one task's memory use would fragment every other task's pos-delete output. I don't think a process-wide heap ratio can tell us anything about this writer's own buffer.