Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis-port 迁移数据报错 #44

Open
zyi1992 opened this issue Nov 1, 2017 · 3 comments
Open

redis-port 迁移数据报错 #44

zyi1992 opened this issue Nov 1, 2017 · 3 comments

Comments

@zyi1992
Copy link

zyi1992 commented Nov 1, 2017

2017/11/01 17:27:40 main.go:189: [INFO] set ncpu = 4, parallel = 16
2017/11/01 17:27:40 sync.go:56: [INFO] sync from '10.10.10.52:6679' to '10.10.10.55:8899'
2017/11/01 17:27:40 utils.go:139: [PANIC] invalid psync response, fullsync
[error]: bad resp CRLF end
6 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/pkg/redis/decoder.go:166
github.com/CodisLabs/redis-port/pkg/redis.(*decoder).decodeSingleLineBulkBytesArray
5 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/pkg/redis/decoder.go:85
github.com/CodisLabs/redis-port/pkg/redis.(*decoder).decodeResp
4 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/pkg/redis/decoder.go:28
github.com/CodisLabs/redis-port/pkg/redis.Decode
3 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/utils.go:137
main.sendPSyncFullsync
2 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/sync.go:115
main.(*cmdSync).SendPSyncCmd
1 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/sync.go:67
main.(*cmdSync).Main
0 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/main.go:199
main.main
... ...
[stack]:
3 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/utils.go:139
main.sendPSyncFullsync
2 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/sync.go:115
main.(*cmdSync).SendPSyncCmd
1 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/sync.go:67
main.(*cmdSync).Main
0 /home/zhouyi/go/src/github.com/CodisLabs/redis-port/cmd/main.go:199
main.main

迁移使用的命令是
./redis-port sync --psync --ncpu=4 -p 16 --from=10.10.10.52:6679 --filterdb=1 --target=10.10.10.55:8899 --sockfile=test.tmp --filesize=32gb
redis客户端是3.2版本的

@spinlock
Copy link
Member

这个是协议解析错误,不应该的。

@zyi1992
Copy link
Author

zyi1992 commented Dec 19, 2017

当时迁移的时候一直报这个错误 后来又试了几次,偶尔能成功一次,也就迁移完了,但是并不知道出错是是什么原因,我的场景下单个redis实例的内存在50gb左右,有多个zadd 添加的有序集合,单个集合的规模在千万级别,不知道是不是这些因素导致的。

@spinlock
Copy link
Member

spinlock commented Jan 9, 2018

理论上不是,我怀疑是对 redis 在生成 rdb 过程中的协议理解上或者实现上存在问题。

在生成 RDB 过程中,server 会不停地回复 '\n',直到返回数据长度,再之后就是正常的 Bulkbytes Array 的指令了。但是你的报错上看到 decodeSingleLineBulkBytesArray ,就是说我开始按照 String 开始解析 Redis 指令,而不是 Bulkbytes Array,说明我在第三步收到的指令格式完全不对。我回去翻翻 Redis 代码再看一下,我怀疑这里面理解上有错误。或者 Bug。但是我很难复现,因为我没环境。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants