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

迁移大list问题 #33

Closed
beyondblog opened this issue Feb 15, 2017 · 9 comments
Closed

迁移大list问题 #33

beyondblog opened this issue Feb 15, 2017 · 9 comments

Comments

@beyondblog
Copy link

大神们好! ,在迁移过程中出现了一个错误 如下:

2017/02/15 18:25:55 [PANIC] parse command arguments failed
[error]: expect Array, but got <*redis.BulkBytes>
    2   /root/.gvm/pkgsets/go1.5/global/src/github.com/CodisLabs/redis-port/pkg/redis/resp.go:163
            github.com/CodisLabs/redis-port/pkg/redis.AsArray
    1   /root/.gvm/pkgsets/go1.5/global/src/github.com/CodisLabs/redis-port/pkg/redis/handler.go:88
            github.com/CodisLabs/redis-port/pkg/redis.ParseArgs
    0   /root/.gvm/pkgsets/go1.5/global/src/github.com/CodisLabs/redis-port/cmd/sync.go:258
            main.(*cmdSync).SyncCommand.func2
        ... ...
[stack]:
    0   /root/.gvm/pkgsets/go1.5/global/src/github.com/CodisLabs/redis-port/cmd/sync.go:259
            main.(*cmdSync).SyncCommand.func2
        ... ...

猜测可能是某个key的的value太大导致的

目前有个list 类型的key value 大约有几千万条 - - ...

我该如何解决这个问题呢?

@spinlock
Copy link
Member

@beyondblog 这个我想过,需要改代码。现在的策略是直接 RDB restore 给 slave,单数据太大的话,肯定失败 (>512MB),这种时候,看来需要手动的切成小的指令,比如 RPUSH 来操作。

@spinlock
Copy link
Member

@beyondblog 不过从你的 log 上,你并不是这个问题。出错在于命令解析错误,不合法。

@spinlock
Copy link
Member

spinlock commented Feb 21, 2017

@beyondblog 现在应该可以了,pull 最新的代码试试看。

f79bd50

@beyondblog
Copy link
Author

@spinlock 非常感谢! 稍后我试下! 😄

@luweijie007
Copy link

@spinlock 我也越到了一样的问题
2017/03/16 11:02:25 sync.go:235: [INFO] total=2908349195 - 2864928461 [ 98%] entry=5111118
2017/03/16 11:02:26 sync.go:235: [INFO] total=2908349195 - 2868982634 [ 98%] entry=5120844
2017/03/16 11:02:27 sync.go:235: [INFO] total=2908349195 - 2873281677 [ 98%] entry=5130978
2017/03/16 11:02:28 sync.go:235: [INFO] total=2908349195 - 2878549522 [ 98%] entry=5141108
2017/03/16 11:02:29 sync.go:235: [INFO] total=2908349195 - 2884614954 [ 99%] entry=5157670
2017/03/16 11:02:30 sync.go:235: [INFO] total=2908349195 - 2891919471 [ 99%] entry=5172628
2017/03/16 11:02:31 sync.go:235: [INFO] total=2908349195 - 2898386154 [ 99%] entry=5185882
2017/03/16 11:02:32 sync.go:235: [INFO] total=2908349195 - 2903861685 [ 99%] entry=5196923
2017/03/16 11:02:33 sync.go:235: [INFO] total=2908349195 - 2908300354 [ 99%] entry=5207640
2017/03/16 11:02:33 sync.go:235: [INFO] total=2908349195 - 2908349187 [ 99%] entry=5211041
2017/03/16 11:02:33 sync.go:237: [INFO] sync rdb done
2017/03/16 11:02:33 sync.go:259: [PANIC] parse command arguments failed
[error]: expect Array, but got <*redis.BulkBytes>
2 /usr/local/share/go/src/github.com/CodisLabs/redis-port/pkg/redis/resp.go:163
github.com/CodisLabs/redis-port/pkg/redis.AsArray
1 /usr/local/share/go/src/github.com/CodisLabs/redis-port/pkg/redis/handler.go:88
github.com/CodisLabs/redis-port/pkg/redis.ParseArgs
0 /usr/local/share/go/src/github.com/CodisLabs/redis-port/cmd/sync.go:258
main.(*cmdSync).SyncCommand.func2
已经是最新的代码了,是从一个redis服务导入数据到codis-proxy,每次都是到99%的时候,出现这个问题

@spinlock
Copy link
Member

@luweijie007 这个很奇怪。。。

先说你已经完成 rdb 同步了,错误出现在追 log 的过程。但是 log 应该都是 BulkBytes Array 才对的。我不确定是不是 redis 某个版本改了协议还是我处理的有问题。

@spinlock spinlock reopened this Mar 16, 2017
@luweijie007
Copy link

luweijie007 commented Mar 16, 2017

redis的版本和同步时候的日志如下,很正常,还有有用的信息我能查看的?
redis_version:3.0.6
3310:S 16 Mar 11:20:37.271 * Slave 10.15.107.143: asks for synchronization
3310:S 16 Mar 11:20:37.272 * Full resync requested by slave 10.15.107.143:
3310:S 16 Mar 11:20:37.272 * Starting BGSAVE for SYNC with target: disk
3310:S 16 Mar 11:20:37.279 * Background saving started by pid 6412
6412:C 16 Mar 11:21:24.306 * DB saved on disk
6412:C 16 Mar 11:21:24.307 * RDB: 6374 MB of memory used by copy-on-write
3310:S 16 Mar 11:21:24.415 * Background saving terminated with success
3310:S 16 Mar 11:30:00.668 * Synchronization with slave 10.15.107.143: succeeded
3310:S 16 Mar 11:30:08.991 # Connection with slave client id #20 lost.
是不是同步的数据太大6374 MB?
补充一下,redis服务的配置rdbchecksum 是关闭的,codis-port里面检查checksum的地方修改跳过检查,
这个有影响吗?

@spinlock
Copy link
Member

spinlock commented Mar 16, 2017 via email

@luweijie007
Copy link

--sockfile=FILE [--filesize=SIZE,这2个参数吗?具体怎么设值,能贴下吗?

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

3 participants