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

Add LWW-Element-Set with Add-Wins semantic for equal timestamp #102

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

russelldb
Copy link
Member

An LWW-Element-Set similar to Roshi/The Shapiro Tech Report. When an add and remove on the same element have the same timestamp, the add wins. Why? Makes sense to me that you only remove a element you've seen in the set, and if you remove a at time 1 then the a you saw must have been added at some time <1. Therefore an add of a at 1 is not the same a the remove wants to remove.

If there is a need for a remove wins version, we could tweak this impl to provide either based on some setup param, I guess.

Despite what the Roshi docs say, there is no GC, and there are in fact tombstones. Once an element is added it will always take up space in the datastructure.

Also, "doomstones" allowed (you can remove {a, 100000} when a is not present, and no add of a less than 100000 will work.)

@russelldb russelldb mentioned this pull request Aug 3, 2014
@cmeiklejohn
Copy link
Contributor

Two dialyzer errors:

riak_dt_lwwset.erl:109: Invalid type specification for function riak_dt_lwwset:add_elem/3. The success typing is (_,_,[{_,_}]) -> [{_,_}]
riak_dt_lwwset.erl:123: Invalid type specification for function riak_dt_lwwset:remove_elem/3. The success typing is (_,_,[{_,_}]) -> [{_,_}]

@peterbourgon
Copy link

Despite what the Roshi docs say, there is no GC, and there are in fact tombstones.

I'll update Roshi's docs to clarify my (perhaps eccentric) use of the term GC, and explicitly mention the possibility of doomstones (hehe). Thanks for writing!

@russelldb
Copy link
Member Author

Re-based on develop. Brought up to date.

make test passes (including eqc)
dialyzer passes

Just needs a friendly lil' +1 from someone out there…

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

Successfully merging this pull request may close these issues.

8 participants