当前位置:网站首页>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
边栏推荐
- Mds55-16-asemi rectifier module mds55-16
- 大文件如何快速上传?
- Go basic reflection
- Unity_ Code mode add binding button click event
- 分享 20 个不容错过的 ES6 的技巧
- Alexnet model
- C language super complete learning route (collection allows you to avoid detours)
- Llvm - generate local variables
- Redis cluster principle
- nuxt项目:全局获取process.env信息
猜你喜欢
8.5 concise implementation of cyclic neural network
Explain TCP's three handshakes in detail
eolink 如何助力远程办公
Daily question - leetcode396 - rotation function - recursion
Leetcode153 - find the minimum value in the rotation sort array - array - binary search
OC to swift conditional compilation, marking, macro, log, version detection, expiration prompt
nuxt项目:全局获取process.env信息
win10 任务栏通知区图标不见了
Progress in the treatment of depression
Borui data and F5 jointly build the full data chain DNA of financial technology from code to user
随机推荐
Subnet division of flannel principle
like和regexp差别
大文件如何快速上传?
TLS / SSL protocol details (30) RSA, DHE, ecdhe and ecdh processes and differences in SSL
Leetcode165 compare version number double pointer string
让阿里P8都为之着迷的分布式核心原理解析到底讲了啥?看完我惊了
Daily question - leetcode396 - rotation function - recursion
Reptile exercises (1)
Alexnet model
async void 导致程序崩溃
Five data types of redis
【thymeleaf】处理空值和使用安全操作符
脏读、不可重复读和幻读介绍
My raspberry PI zero 2W tossing notes record some problems encountered and solutions
Difference between like and regexp
Three uses of kprobe
Llvm - generate for loop
How to upload large files quickly?
About UDP receiving ICMP port unreachable
牛客网数据库SQL实战详细剖析(26-30)