From 884de89cb8b0534f892b7df76bf80ba82e04133f Mon Sep 17 00:00:00 2001 From: siddontang Date: Thu, 9 Oct 2014 11:47:14 +0800 Subject: [PATCH] replication add log --- server/replication.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/replication.go b/server/replication.go index b8b1868..1f12b93 100644 --- a/server/replication.go +++ b/server/replication.go @@ -287,7 +287,10 @@ func (app *App) removeSlave(c *client) { app.slock.Lock() defer app.slock.Unlock() - delete(app.slaves, c) + if _, ok := app.slaves[c]; ok { + delete(app.slaves, c) + log.Info("remove slave %s", c.remoteAddr) + } if c.ack != nil { asyncNotifyUint64(c.ack.ch, c.lastLogID) @@ -313,7 +316,7 @@ func (app *App) publishNewLog(l *rpl.Log) { logId := l.ID for s, _ := range app.slaves { if s.lastLogID >= logId { - //slave has already this log + //slave has already owned this log ss = []*client{} break } else {