cshuo opened a new issue, #20863:
URL: https://github.com/apache/hudi/issues/20863

   Source V2 passes the raw MiB value into `maxCompactionMemoryInBytes`. This 
can cause the CDC reader to spill to disk earlier than configured. [Affected 
line](https://github.com/apache/hudi/blob/4add869563117e5e3c048c0a27939c05bce2282a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSource.java#L347)
   
   **Reproduction**
   
   Insert one record into a CDC-enabled COW table, plan an incremental read 
with `read.source-v2.enabled = true`, and inspect 
`HoodieCdcSourceSplit.getMaxCompactionMemoryInBytes()`.
   
   | Configured (MiB) | Expected (bytes) | Actual (bytes) |
   |---:|---:|---:|
   | 100 | 104,857,600 | 100 |
   | 256 | 268,435,456 | 256 |
   
   **Fix**
   
   Pass `this.maxCompactionMemoryInBytes` to the scan context builder. The 
constructor already converts the value to bytes. 
[Constructor](https://github.com/apache/hudi/blob/4add869563117e5e3c048c0a27939c05bce2282a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSource.java#L211)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to