zhuzhao.cx 6 years ago committed by vinllen
parent d1d32cd4c9
commit 383d3341b1
  1. 13
      src/redis-shake/sync.go

@ -419,10 +419,15 @@ func (cmd *CmdSync) SyncCommand(reader *bufio.Reader, target, auth_type, passwd
} }
} }
if node != nil && node.id == recvId.Get() { if node != nil {
// cmd.SyncStat.Delay.Add(time.Now().Sub(node.t).Nanoseconds()) id := recvId.Get() // receive id
metric.MetricVar.AddDelay(uint64(time.Now().Sub(node.t).Nanoseconds()) / 1000000) // ms if node.id == id {
node = nil // cmd.SyncStat.Delay.Add(time.Now().Sub(node.t).Nanoseconds())
metric.MetricVar.AddDelay(uint64(time.Now().Sub(node.t).Nanoseconds()) / 1000000) // ms
node = nil
} else if node.id > id {
log.Panicf("receive id invalid: node-id[%v] > receive-id[%v]", node.id, id)
}
} }
} }
}() }()

Loading…
Cancel
Save