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

Snapshotting pseudo state & log entry cache #2257

Merged
merged 5 commits into from
Apr 13, 2015
Merged

Snapshotting pseudo state & log entry cache #2257

merged 5 commits into from
Apr 13, 2015

Conversation

benbjohnson
Copy link
Contributor

Overview

This pull request contains multiple changes/fixes for the raft package:

  • Manage requests better while snapshotting. Currently a large snapshot will lock the log and queue up heartbeats & possibly cause an election timeout when it's done. There is now a Log.snapshotting field that is set using the sync/atomic package.
  • Add a log entry cache so that temporarily disconnected streams can reconnect without requiring a snapshot.
  • Wrap the Log.mu mutex with lock() and unlock() methods for lock contention debugging. There's also a printCaller() method that will log the file & line of the calling function to a lock.

@@ -1780,6 +1829,8 @@ func (l *Log) ReadFrom(r io.ReadCloser) error {
return nil
}

l.Logger.Printf("reading from stream")
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you still want this for debugging?

Copy link
Contributor

Choose a reason for hiding this comment

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

nm, I see a bunch of them below, assuming this is needed for debugging in the wild.

@otoolep
Copy link
Contributor

otoolep commented Apr 13, 2015

Interesting change, generally makes sense. I do have questions about how the system will respond if stuff that used to happen anyway, is now explicitly blocked by an active snapshot.

@otoolep
Copy link
Contributor

otoolep commented Apr 13, 2015

+1, change generally makes sense.

@toddboom
Copy link
Contributor

👍 from me too

benbjohnson added a commit that referenced this pull request Apr 13, 2015
Snapshotting pseudo state & log entry cache
@benbjohnson benbjohnson merged commit 04baf9b into master Apr 13, 2015
@benbjohnson benbjohnson deleted the raft branch April 13, 2015 20:06
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

4 participants