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

Highest Write Wins flag, register, map and set #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

drewhk
Copy link

@drewhk drewhk commented Oct 2, 2014

Only for discussion not finished yet

@drewhk
Copy link
Author

drewhk commented Oct 2, 2014

Bit lacking on comments now, will add more info later.

@patriknw
Copy link
Owner

patriknw commented Oct 2, 2014

@drewhk This looks great at a first overflight. Is it described in some paper, or is it invented by Varga?

It will require protobuf serialization, i.e. with ReplicatedDataSerialization.


def value: Boolean = (state & 1) == 1

def setValue(b: Boolean): HWWFlag =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setValue is a bit strange for an immutable data type, perhaps withValue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this. The problem is that a name that is passive does not convey the meaning that you should not just cache True/False values but always operate on the latest value by setting it. I don't know what name would be nice here.

@drewhk
Copy link
Author

drewhk commented Oct 3, 2014

I don't know if this is invented or reinvented by me, but I haven't read about such a structure before. I will add the serialization formats later, I just wanted a validation first so I flushed what I had here.

@drewhk
Copy link
Author

drewhk commented Oct 3, 2014

Btw, according to this: http://www.bailis.org/blog/linearizability-versus-serializability/
both the register and flag are serializable (but not linarizable), and the set and map are serializable per entry (but not over all entries). Interestingly ORSet as far as I see is neither. It would be interesting to investigate the differences and why one of the behaviors might be preferred over the other in different use-cases.

@@ -0,0 +1,24 @@
package akka.contrib.datareplication

object HWWFlag {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand the end user semantics.
In the case of concurrent updates during a partition the most active replica (or side of the partition) will win. By "most active" I mean changing the flag back and forth most number of times.
Is that correct understanding?

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.

2 participants