hudi icon indicating copy to clipboard operation
hudi copied to clipboard

[HUDI-7228] Fix eager closure of log reader input streams with log record reader

Open nsivabalan opened this issue 1 year ago • 2 comments

Change Logs

Fix eager closure of log reader input streams with log record reader. While reading log blocks, we do make sure to close the actual content and release it for GC purposes. But the inputstream instantiated with log record reader is not closed. Fixing the same in this patch.

Impact

Fix eager closure of log reader input streams with log record reader. Memory usage when reading 100+ log files will be reduced to minimal.

Memory snapshot before this patch: 25 log files/25 log blocks were present in the file slice of interest.

image

Notice 25 instances of input streams open.

Memory snapshot after this patch. Dump taken just after reading all log block headers, but before starting to deser any block for records. image

Risk level (write none, low medium or high below)

If medium or high, explain what verification was done to mitigate the risks.

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the ticket number here and follow the instruction to make changes to the website.

Contributor's checklist

  • [ ] Read through contributor's guide
  • [ ] Change Logs and Impact were stated clearly
  • [ ] Adequate tests were added if applicable
  • [ ] CI passed

nsivabalan avatar Dec 16 '23 00:12 nsivabalan

I see many test failures the input stream of log reader can not be closed: https://github.com/apache/hudi/actions/runs/7228545731/job/19698162762?pr=10340#step:6:7650

danny0405 avatar Dec 16 '23 02:12 danny0405

@nsivabalan : Looks like the PR is already approved but needs fixing conflicts. Are you planning to merge this at later time ?

bvaradar avatar Jan 23 '24 05:01 bvaradar

Yeah,it is already cherry-picked into 0.14.1 release, just resolve the conflicts and we are good to merge.

danny0405 avatar Jan 24 '24 02:01 danny0405

Fixed Conflicts and updated the diff

bvaradar avatar Jan 24 '24 17:01 bvaradar

CI report:

  • f401ab103abf2eb6e2827a98fa8627795642f064 Azure: FAILURE
Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

hudi-bot avatar Jan 24 '24 20:01 hudi-bot