badger icon indicating copy to clipboard operation
badger copied to clipboard

fix(table cache) block cache logic for table with no compression

Open hugy718 opened this issue 1 year ago • 1 comments

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.

hugy718 avatar Oct 17 '23 09:10 hugy718

Deploy Preview for badger-docs ready!

Name Link
Latest commit d01e622973593d0a2abdcbe177a6770ce063984b
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.

netlify[bot] avatar Oct 17 '23 09:10 netlify[bot]

This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

github-actions[bot] avatar Jul 16 '24 01:07 github-actions[bot]