当前位置:网站首页>redis-shake 使用中遇到的错误整理
redis-shake 使用中遇到的错误整理
2022-04-23 15:08:00 【沉淅尘】
redis-shake 使用中遇到的错误整理
本文记录一下,笔者在使用 redis-shake 遇到的一些错误
redis-shake decode 错误测试
在运行 redis-shake 的 decode 模式时出现下面错误,但是百度和谷歌找不到答案,错误信息:
2022/04/23 09:45:49 [PANIC] parse rdb header error
[error]: EOF
5 github.com/alibaba/RedisShake/pkg/rdb/reader.go:102
github.com/alibaba/RedisShake/pkg/rdb.(*rdbReader).Read
4 io/io.go:328
io.ReadAtLeast
3 io/io.go:347
io.ReadFull
2 github.com/alibaba/RedisShake/pkg/rdb/reader.go:445
github.com/alibaba/RedisShake/pkg/rdb.(*rdbReader).readFull
1 github.com/alibaba/RedisShake/pkg/rdb/loader.go:34
github.com/alibaba/RedisShake/pkg/rdb.(*Loader).Header
0 github.com/alibaba/RedisShake/redis-shake/common/utils.go:953
github.com/alibaba/RedisShake/redis-shake/common.NewRDBLoader.func1
从报错信息上看,是在 github.com/alibaba/RedisShake/redis-shake/common/utils.go
953 行代码出错,而且还是 io 读取文件出错
这个错误就很奇怪了,为什么读取的 rdb 文件会出错?因为笔者的 rdb 文件是运行 redis-shake 的 dump 模式得到的
这时笔者想到 redis-shake 是开源,就拉取官方源代码进行测试,这里是把 decode 部分代码简化出来,并不是完整流程,只是到笔者报错的地方
把文件读取的流程整理出来,从运行 redis-shake 的机器上拉取这个 rdb 文件进行测试
当笔者把代码都切割出来后,重新在运行 go 程序,发现并没有报错,正常读取了文件;然后重新在 redis-shake 的机器上运行 decode 模式,发现正常了
真是让人哭笑不得,不过后面思考了一下出现这个问题原因,应该是这个 rdb 文件格式问题
因为笔者后面测试的 rdb 文件其实是重新运行 dump 模式生成的新文件,一开始使用的 rdb 文件是前一天生成并且多次运行 dump 覆盖的,可能导致有一些问题
结论
redis-shake 生成的 rdb 文件尽量别多次覆盖模式,每一次最好都重新命名
笔者代码
https://github.com/MoGD2018/go-study/tree/main/go-redis-shake-decode
版权声明
本文为[沉淅尘]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_41335923/article/details/124361795
边栏推荐
- Llvm - generate if else and pH
- tcp_ Diag kernel related implementation 1 call hierarchy
- TLS / SSL protocol details (30) RSA, DHE, ecdhe and ecdh processes and differences in SSL
- How to design a good API interface?
- 大文件如何快速上传?
- C语言超全学习路线(收藏让你少走弯路)
- C语言超全学习路线(收藏让你少走弯路)
- Set onedrive or Google drive as a drawing bed in upic for free
- 脏读、不可重复读和幻读介绍
- Five data types of redis
猜你喜欢
How to design a good API interface?
TLS / SSL protocol details (30) RSA, DHE, ecdhe and ecdh processes and differences in SSL
LeetCode165-比较版本号-双指针-字符串
博睿数据携手F5共同构建金融科技从代码到用户的全数据链DNA
OC to swift conditional compilation, marking, macro, log, version detection, expiration prompt
Provided by Chengdu control panel design_ It's detailed_ Introduction to the definition, compilation and quotation of single chip microcomputer program header file
1n5408-asemi rectifier diode
让阿里P8都为之着迷的分布式核心原理解析到底讲了啥?看完我惊了
Progress in the treatment of depression
LeetCode151-颠倒字符串中的单词-字符串-模拟
随机推荐
Compiling OpenSSL
Go basic reflection
【thymeleaf】处理空值和使用安全操作符
UML学习_day2
The life cycle of key value in redis module programming
Introduction to distributed transaction Seata
js——實現點擊複制功能
Application of skiplist in leveldb
Fill in the next right node pointer II of each node [classical hierarchy traversal | regarded as linked list]
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
JS -- realize click Copy function
Basic operation of circular queue (Experiment)
SSH connects to the remote host through the springboard machine
Leetcode153 - find the minimum value in the rotation sort array - array - binary search
Explanation and example application of the principle of logistic regression in machine learning
Leetcode165 compare version number double pointer string
Bingbing learning notes: take you step by step to realize the sequence table
On the day of entry, I cried (mushroom street was laid off and fought for seven months to win the offer)
Five data types of redis
LeetCode165-比较版本号-双指针-字符串