yorkie icon indicating copy to clipboard operation
yorkie copied to clipboard

Implement GC for RHT Node

Open raararaara opened this issue 4 months ago • 1 comments

What would you like to be added:

Add a feature to RHT that allows the removal of attributes from elements

Currently, when performing Tree.RemoveStyle and calling RHT.Remove, the actual removal from the map is not performed. This is to avoid potential convergence issues in concurrent editing scenarios. Instead, the RHT Node is marked as isRemoved.

https://github.com/yorkie-team/yorkie/blob/5ce2aa3d7b83f6e0ac4433c4c6a34662dbc7b10f/pkg/document/crdt/rht.go#L122-L123

However, this approach of just marking the nodes as isRemoved can lead to memory issues if the number of marked RHT Nodes keeps increasing. Therefore, it is necessary to implement a garbage collector that handles tombstones to remove the marked nodes from memory.

Why is this needed:

To address potential memory issues caused by the increasing number of marked RHT Nodes and improve the efficiency of the RHT implementation.

raararaara avatar Feb 16 '24 05:02 raararaara