Merge pull request #197 from alibaba/feature-1.6

Feature 1.6
v4
Vinllen Chen 5 years ago committed by GitHub
commit 8703c41906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      ChangeLog
  2. 2
      README.md
  3. 6
      src/redis-shake/common/crc16.go
  4. 4
      src/redis-shake/common/utils.go
  5. 10
      src/redis-shake/sync.go
  6. 6
      src/vendor/vendor.json

@ -1,3 +1,19 @@
2019-11-28 Alibaba Cloud.
* VERSION: 1.6.23
* BUGFIX: update redis-go-cluster driver to solve MOVED error in lua
script.
* BUGFIX: update redis-go-clister driver to remove the error when meets
nil bluk string.
* IMPROVE: add keep_alive in cluster connection.
2019-11-25 Alibaba Cloud.
* VERSION: 1.6.22
* BUGFIX: solve MOVED error when key is unicode encoding which is not
solved completed in v1.6.21.
* BUGFIX: update redis-go-cluster to solve the bug of \r\n. see #73 in
redis-full-check.
* BUGFIX: solve flushcount comparison: "flushcount=4097 > 4096" =>
"flushcount=4096 >= 4096".
* IMPROVE: add more log in redis-go-cluster.
2019-11-12 Alibaba Cloud.
* VERSION: 1.6.21
* BUGFIX: update redis-go-cluster to solve the MOVED error when target

@ -30,7 +30,7 @@ Supports `Standalone`, `Cluster`, and some proxies type like `Codis`, `twemproxy
For `codis` and `twemproxy`, there maybe some constraints, please checkout this [question](https://github.com/alibaba/RedisShake/wiki/FAQ#q-does-redisshake-supports-codis-and-twemproxy).
# Configuration
Redis-shake has several parameters in the configuration(`conf/redis-shake.conf`) that maybe confusing, if this is your first time using, just configure the `source.address` and `target.address` parameters.
Redis-shake has several parameters in the configuration(`conf/redis-shake.conf`) that maybe confusing, if this is your first time using, please visit this [tutorial](https://github.com/alibaba/RedisShake/wiki/tutorial-about-how-to-set-up).
# Verification
---

@ -81,8 +81,8 @@ var crc16tab = [256]uint16{
func crc16(buf string) uint16 {
var crc uint16
for _, n := range buf {
crc = (crc << uint16(8)) ^ crc16tab[((crc>>uint16(8))^uint16(n))&0x00FF]
for i := 0; i < len(buf); i++ {
crc = (crc << uint16(8)) ^ crc16tab[((crc>>uint16(8))^uint16(buf[i]))&0x00FF]
}
return crc
}
}

@ -41,11 +41,11 @@ func OpenRedisConnWithTimeout(target []string, auth_type, passwd string, readTim
cluster, err := redigoCluster.NewCluster(
&redigoCluster.Options{
StartNodes: target,
ConnTimeout: 1 * time.Second,
ConnTimeout: 30 * time.Second,
ReadTimeout: readTimeout,
WriteTimeout: writeTimeout,
KeepAlive: 16,
AliveTime: 60 * time.Second,
AliveTime: time.Duration(conf.Options.KeepAlive) * time.Second,
Password: passwd,
})
if err != nil {

@ -535,7 +535,7 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
id := recvId.Get() // receive id
// print debug log of receive reply
log.Debugf("receive reply-id[%v]: [%v], error:[%v]", id, reply, err)
log.Debugf("dbSyncer[%v] receive reply-id[%v]: [%v], error:[%v]", ds.id, id, reply, err)
if conf.Options.Metric == false {
continue
@ -588,7 +588,7 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
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 {
ignorecmd := false
@ -601,7 +601,7 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
metric.GetMetric(ds.id).AddPullCmdCount(ds.id, 1)
// print debug log of send command
if conf.Options.LogLevel == utils.LogLevelDebug {
if conf.Options.LogLevel == utils.LogLevelDebug || conf.Options.LogLevel == utils.LogLevelAll {
strArgv := make([]string, len(argv))
for i, ele := range argv {
strArgv[i] = *(*string)(unsafe.Pointer(&ele))
@ -688,8 +688,8 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
ds.addDelayChan(sendId.Get())
}
if noFlushCount > conf.Options.SenderCount || cachedSize > conf.Options.SenderSize ||
len(ds.sendBuf) == 0 { // 5000 ds in a batch
if noFlushCount >= conf.Options.SenderCount || cachedSize >= conf.Options.SenderSize ||
len(ds.sendBuf) == 0 { // 5000 ds in a batch
err := c.Flush()
noFlushCount = 0
cachedSize = 0

@ -159,10 +159,10 @@
"revisionTime": "2019-03-04T09:57:49Z"
},
{
"checksumSHA1": "GYdlJZBp2zfh0QEV/MN4M0L1nPE=",
"checksumSHA1": "Y95c1YwyU+rB+mFMSB4zhxCpt+Q=",
"path": "github.com/vinllen/redis-go-cluster",
"revision": "83c0ea01d33aea24bb40b9d46a85fb56dac543cb",
"revisionTime": "2019-11-12T06:34:43Z"
"revision": "f33d5a7283f2dc28233aa0069d7ec1798323cdad",
"revisionTime": "2019-11-28T04:11:03Z"
},
{
"checksumSHA1": "U4rR1I0MXcvJz3zSxTp3hb3Y0I0=",

Loading…
Cancel
Save