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

Periodically trigger database writes when write volume is insufficient #39

Merged
merged 9 commits into from
Mar 28, 2017

Conversation

willscott
Copy link
Member

Introduce a NextEpoch RPC between leader and followers so leader can explicitly trigger a database flip.

This is gonna be a weird thing to try and get consistent order. I'm not convinced this is the 'correct' way. Instead, there should be a flag in a write that follows the same channel delivery system to signal it. The problem is how followers can identify the special write has been triggered by the leader, and isn't a malicious client RPC. This works as a placehodler until that solution is done.

Copy link
Member

@ryscheng ryscheng left a comment

Choose a reason for hiding this comment

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

Only comment is about Bucket(). I'm not gonna worry too much about the rest of it, because we've already discussed how this is going to be refactored anyway

@@ -45,6 +47,30 @@ func (r *ReadArgs) Encode(trustDomains []*TrustDomainConfig) (out EncodedReadArg
return
}

// Bucket returns the bucket index that a read requests, or -1 for invalid args.
func (r *ReadArgs) Bucket() int {
Copy link
Member

Choose a reason for hiding this comment

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

This function is unused?

I'd either add some tests or remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the function for debugging. it was nice to be able to recover the bucket i was expecting a write to go into / a read to be of as it left the RequestManager. I'll add a test.

@willscott willscott merged commit f9d2751 into periodicread Mar 28, 2017
@willscott willscott deleted the periodicwrite branch March 28, 2017 02:39
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.

None yet

2 participants