rotationalio / honu

Adaptive consistency replication with reinforcement learning for large scale globally distributed storage.
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

Store tombstone in parent on update #3

Closed will2041 closed 2 years ago

will2041 commented 2 years ago

Reference lines - https://github.com/rotationalio/honu/blob/d13a85a7085761866126a4c1beddad74ef989e79/versions.go#L56-L61

Implementation does not copy tombstone data into the parent version. This creates a problem when backtracking through history. A deleted object will not have a stored tombstone transition and can only be identified by looking at nil data.

Storing the tombstone allows for a reconstruction of the history of the object, which is necessary when defining expected behavior for users.

Line 61 just needs:

Tombstone: meta.Version.Tombstone,

Bonus points for adding a complete clone() method for taking care of Version copying. :D