forked from mirror/ledisdb
replication add log
This commit is contained in:
parent
137bd19951
commit
884de89cb8
|
@ -287,7 +287,10 @@ func (app *App) removeSlave(c *client) {
|
||||||
app.slock.Lock()
|
app.slock.Lock()
|
||||||
defer app.slock.Unlock()
|
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 {
|
if c.ack != nil {
|
||||||
asyncNotifyUint64(c.ack.ch, c.lastLogID)
|
asyncNotifyUint64(c.ack.ch, c.lastLogID)
|
||||||
|
@ -313,7 +316,7 @@ func (app *App) publishNewLog(l *rpl.Log) {
|
||||||
logId := l.ID
|
logId := l.ID
|
||||||
for s, _ := range app.slaves {
|
for s, _ := range app.slaves {
|
||||||
if s.lastLogID >= logId {
|
if s.lastLogID >= logId {
|
||||||
//slave has already this log
|
//slave has already owned this log
|
||||||
ss = []*client{}
|
ss = []*client{}
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue