Skip to content

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

Open
russelldb wants to merge 20 commits intodevelopfrom
feature/rdb/gh101-lwwset
Open

Add LWW-Element-Set with Add-Wins semantic for equal timestamp#102
russelldb wants to merge 20 commits intodevelopfrom
feature/rdb/gh101-lwwset

Conversation

@russelldb
Copy link
Contributor

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 russelldb force-pushed the feature/rdb/gh101-lwwset branch from 083d89b to ea3a425 Compare January 11, 2018 12:18
@russelldb
Copy link
Contributor 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