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

design: Add raft.md #2318

Merged
merged 1 commit into from
Jul 20, 2017
Merged

design: Add raft.md #2318

merged 1 commit into from
Jul 20, 2017

Conversation

aaronlehmann
Copy link
Collaborator

This document explains how the Raft implementation works.

@codecov
Copy link

codecov bot commented Jul 18, 2017

Codecov Report

Merging #2318 into master will increase coverage by 0.09%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2318      +/-   ##
==========================================
+ Coverage    60.1%   60.19%   +0.09%     
==========================================
  Files         128      128              
  Lines       25930    25891      -39     
==========================================
+ Hits        15584    15585       +1     
+ Misses       8956     8920      -36     
+ Partials     1390     1386       -4

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

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

Thanks for writing this up! It's very helpful! Minor edits, but LGTM

design/raft.md Outdated
a distributed fashion, we would need some mechanism to resolve conflicts between
writes made by different nodes. Limiting decision-making to the leader avoids
the need for this, since we can be certain that there is at most one leader at
any time.
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking - this is probably understood, it may be useful to mention that the leader has the latest version of the store at any given time, which is another reason why it's useful to run all these services on the leader.

design/raft.md Outdated
any time.

The basic rule is that anything which writes to the Raft-backed data store needs
to run on the manager. If a follower node tries to write to the data store, the
Copy link
Contributor

Choose a reason for hiding this comment

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

Should "on the manager" be "on the leader"?

combination of sending snapshots and log entries. It can take a little while for
a new node to become a functional member of the consensus group, because it
needs to receive this data first.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to say here that as a node is caught up, when it is catching up by means of log entries, it basically plays each log entry, so if something is watching for changes as it is playing through those entries, they'll get lots of update events instead of one final state?

This detail caused some possible issues when I was doing CA rotation, and could be a gotcha to keep in mind.

This document explains how the Raft implementation works.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann
Copy link
Collaborator Author

Updated.


WALs and snapshots are both stored encrypted, even if the autolock feature is
disabled. With autolock turned off, the data encryption key is stored on disk in
plaintext, in a header inside the TLS key. When autolock is turned on, the data
Copy link
Contributor

Choose a reason for hiding this comment

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

This last sentence is a tongue twister 🤣

@cyli cyli merged commit b2addbc into moby:master Jul 20, 2017
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.

4 participants