Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store tombstone in parent on update #3

Closed
will2041 opened this issue Oct 12, 2021 · 0 comments
Closed

Store tombstone in parent on update #3

will2041 opened this issue Oct 12, 2021 · 0 comments

Comments

@will2041
Copy link
Collaborator

Reference lines -

honu/versions.go

Lines 56 to 61 in d13a85a

if meta.Version != nil && !meta.Version.IsZero() {
meta.Version.Parent = &pb.Version{
Pid: meta.Version.Pid,
Version: meta.Version.Version,
Region: meta.Version.Region,
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant