v6d-io / v6d

vineyard (v6d): an in-memory immutable data manager. (Project under CNCF, TAG-Storage)
https://v6d.io
Apache License 2.0
819 stars 117 forks source link

Add block object id contained in global cache object to refcnt map #1828

Closed vegetableysm closed 4 months ago

vegetableysm commented 4 months ago

Describe your problem

Currently refcnt map will only store the refcnt of block object held by clients. Refcnt object may delete the block object (refcnt may dec to 0) from the global cache object when all clients exit (or, more generally, when a client that has just updated the global object and exits). If another client pull the global object, it may get a block object that is already deleted by refcnt map.