当前位置:网站首页>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
边栏推荐
- Sqlserver transaction and lock problem
- Provided by Chengdu control panel design_ It's detailed_ Introduction to the definition, compilation and quotation of single chip microcomputer program header file
- Explanation and example application of the principle of logistic regression in machine learning
- 冰冰学习笔记:一步一步带你实现顺序表
- UML学习_day2
- Share 20 tips for ES6 that should not be missed
- Unity_ Code mode add binding button click event
- 8.3 language model and data set
- Difference between like and regexp
- Llvm - generate for loop
猜你喜欢
Introduction to distributed transaction Seata
Five data types of redis
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
8.5 concise implementation of cyclic neural network
Have you learned the basic operation of circular queue?
LeetCode151-颠倒字符串中的单词-字符串-模拟
The win10 taskbar notification area icon is missing
How to design a good API interface?
MySQL error packet out of order
LeetCode 练习——396. 旋转函数
随机推荐
Application of skiplist in leveldb
分布式事务Seata介绍
Design of digital temperature monitoring and alarm system based on DS18B20 single chip microcomputer [LCD1602 display + Proteus simulation + C program + paper + key setting, etc.]
Daily question - leetcode396 - rotation function - recursion
LeetCode151-颠倒字符串中的单词-字符串-模拟
C language super complete learning route (collection allows you to avoid detours)
Thinkphp5 + data large screen display effect
Nacos程序连接MySQL8.0+ NullPointerException
买卖股票的最佳时机系列问题
Compiling OpenSSL
Sqlserver transaction and lock problem
Introduction to Arduino for esp8266 serial port function
分享 20 个不容错过的 ES6 的技巧
adobe illustrator 菜单中英文对照
asp. Net method of sending mail using mailmessage
Leetcode167 - sum of two numbers II - double pointer - bisection - array - Search
nuxt项目:全局获取process.env信息
JS - implémenter la fonction de copie par clic
January 1, 1990 is Monday. Define the function date_ to_ Week (year, month, day), which realizes the function of returning the day of the week after inputting the year, month and day, such as date_ to
Share 20 tips for ES6 that should not be missed