Fix registry cache issues.

This commit is contained in:
Ben Johnson
2013-10-13 21:09:56 -06:00
parent 013d07bc2a
commit d44fd6661a
6 changed files with 27 additions and 8 deletions

View File

@@ -41,6 +41,9 @@ func (c *JoinCommand) Apply(server *raft.Server) (interface{}, error) {
b := make([]byte, 8)
binary.PutUvarint(b, server.CommitIndex())
// Make sure we're not getting a cached value from the registry.
ps.registry.Invalidate(c.Name)
// Check if the join command is from a previous machine, who lost all its previous log.
if _, ok := ps.registry.URL(c.Name); ok {
return b, nil