Skip to content
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(table cache) block cache logic for table with no compression #2022

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hugy718
Copy link
Contributor

@hugy718 hugy718 commented Oct 17, 2023

Problem

Fixes #2021.

The problem is in the block() function in table.go. blk.data takes a slice of the t.Data. If there is no decryption or decompression, it will hold this slice and added to the cache, which means it will always hold a reference of t.Data. That will also preventing GC of the mmap file buffer, so long as a block of it is in cache.

Solution

Make a copy of the block data, when no decryption nor compression.

@netlify
Copy link

netlify bot commented Oct 17, 2023

Deploy Preview for badger-docs ready!

Name Link
🔨 Latest commit d01e622
🔍 Latest deploy log https://app.netlify.com/sites/badger-docs/deploys/652e5431236ac00008d3dbc0
😎 Deploy Preview https://deploy-preview-2022--badger-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: when compression is none block cache will cache the table
1 participant