Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #220 from xiangli-cmu/fix_join
Browse files Browse the repository at this point in the history
fix(join safty) only allow commit to the most recent join command if there is one
  • Loading branch information
xiang90 committed May 14, 2014
2 parents c76c5d9 + d2d1e26 commit 73f9c44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions log.go
Expand Up @@ -379,6 +379,15 @@ func (l *Log) setCommitIndex(index uint64) error {
entry.event.returnValue = returnValue
entry.event.c <- err
}

_, isJoinCommand := command.(JoinCommand)

// we can only commit up to the most recent join command
// if there is a join in this batch of commands.
// after this commit, we need to recalculate the majority.
if isJoinCommand {
return nil
}
}
return nil
}
Expand Down

0 comments on commit 73f9c44

Please sign in to comment.