badger icon indicating copy to clipboard operation
badger copied to clipboard

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

Open hugy718 opened this issue 1 year ago • 0 comments

What version of Badger are you using?

fb1b009595813ae6dabd11628281568c8537f7fd

What version of Go are you using?

1.19.5

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, CPU, OS)?

ubuntu

What steps will reproduce the bug?

Simply create a large table with no compression. Set the table option with a cache. Then load a block from the table with block(). Check its size with size(). You should see its size is the table size.

Expected behavior and actual result.

the block size should be just the block. Note that the this size is also used to set the cache cost, this will quickly fill the table cache.

Additional information

I submitted a PR to fix it. You can use the added unit test to see this bug.

hugy718 avatar Oct 17 '23 09:10 hugy718