yorkie-team / yorkie

Yorkie is a document store for collaborative applications.
https://yorkie.dev
Apache License 2.0
761 stars 140 forks source link

Update RHT DeepCopy method to correctly handle nodes with isRemoved set to true #869

Closed raararaara closed 2 months ago

raararaara commented 3 months ago

What happened: During the DeepCopy operation in RHT (Replicated Hash Table), the set() function is called. However, it has been observed that when isRemoved is set to true, the copied RHTNode always retains a false value for isRemoved. This results in incorrect behavior when dealing with nodes that should have isRemoved set to true.

What you expected to happen: The DeepCopy method should correctly handle nodes with isRemoved set to true, ensuring that the copied RHTNode maintains the correct value for isRemoved.

How to reproduce it (as minimally and precisely as possible): The issue can be reproduced by attempting to DeepCopy an RHTNode with isRemoved set to true and observing that the copied node does not retain the isRemoved value during the operation.

Anything else we need to know?: The DeepCopy method in RHT should be updated to address this issue and ensure that nodes with isRemoved set to true are correctly copied.

Environment: