lotusdblabs / lotusdb

Most advanced key-value database written in Go, extremely fast, compatible with LSM tree and B+ tree.
https://lotusdblabs.github.io
Apache License 2.0
2.09k stars 184 forks source link

这里内存不应该Put回去 #121

Closed shaovie closed 11 months ago

shaovie commented 1 year ago

https://github.com/lotusdblabs/lotusdb/blob/dc886e865defbf6f0631e6308836768a8357248b/hashtable.go#L97C9-L97C20 我跟踪了一下 rosedblabs/diskhash: https://github.com/rosedblabs/diskhash/blob/main/bucket.go#L98 https://github.com/rosedblabs/diskhash/blob/2d051ecdb9a5581cb03eeb2078e61384a7ab96da/bucket.go#L112 这里直接将slot保存起来了 所以不能Put回去,而且也没必要使用pool,没意义

shaovie commented 1 year ago

还有 bytesBuffer.Put(&encPos) 应该改为 bytesBuffer.Put(encPos)

roseduan commented 1 year ago

diskhash 目前不支持的,会在下一个版本发布

shaovie commented 1 year ago

但是代码确实有bug

diskhash 目前不支持的,会在下一个版本发布

akiozihao commented 1 year ago

Fixed in #122