bugfix: flushcount=4097 > 4096 => flushcount=4096 >= 4096

v4
vinllen 5 years ago
parent 3e811b7c3b
commit b1b6082065
  1. 6
      src/redis-shake/sync.go

@ -588,7 +588,7 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
decoder := redis.NewDecoder(reader) decoder := redis.NewDecoder(reader)
log.Infof("dbSyncer[%v] Event:IncrSyncStart\tId:%s\t", ds.id, conf.Options.Id) log.Infof("dbSyncer[%v] FlushEvent:IncrSyncStart\tId:%s\t", ds.id, conf.Options.Id)
for { for {
ignorecmd := false ignorecmd := false
@ -688,8 +688,8 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
ds.addDelayChan(sendId.Get()) ds.addDelayChan(sendId.Get())
} }
if noFlushCount > conf.Options.SenderCount || cachedSize > conf.Options.SenderSize || if noFlushCount >= conf.Options.SenderCount || cachedSize >= conf.Options.SenderSize ||
len(ds.sendBuf) == 0 { // 5000 ds in a batch len(ds.sendBuf) == 0 { // 5000 ds in a batch
err := c.Flush() err := c.Flush()
noFlushCount = 0 noFlushCount = 0
cachedSize = 0 cachedSize = 0

Loading…
Cancel
Save