当前位置:网站首页>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
边栏推荐
- 1n5408-asemi rectifier diode
- Llvm - generate local variables
- Design of digital temperature monitoring and alarm system based on DS18B20 single chip microcomputer [LCD1602 display + Proteus simulation + C program + paper + key setting, etc.]
- How to write the keywords in the cover and title? As we media, why is there no video playback
- MySQL sync could not find first log file name in binary log index file error
- On the day of entry, I cried (mushroom street was laid off and fought for seven months to win the offer)
- Detailed explanation of C language knowledge points -- first understanding of C language [1] - vs2022 debugging skills and code practice [1]
- [NLP] HMM hidden Markov + Viterbi word segmentation
- Alexnet model
- When splicing HQL, the new field does not appear in the construction method
猜你喜欢
About UDP receiving ICMP port unreachable
Swift protocol Association object resource name management multithreading GCD delay once
每日一题-LeetCode396-旋转函数-递推
API gateway / API gateway (II) - use of Kong - load balancing
Mysql连接查询详解
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
Thinkphp5 + data large screen display effect
Brute force of DVWA low -- > High
LeetCode162-寻找峰值-二分-数组
Lotus DB design and Implementation - 1 Basic Concepts
随机推荐
PSYNC synchronization of redis source code analysis
MySQL error packet out of order
填充每个节点的下一个右侧节点指针 II [经典层次遍历 | 视为链表 ]
Pnpm installation and use
Llvm - generate local variables
Nuxt project: Global get process Env information
How to use OCR in 5 minutes
Comparaison du menu de l'illustrateur Adobe en chinois et en anglais
Bingbing learning notes: take you step by step to realize the sequence table
My raspberry PI zero 2W tossing notes record some problems encountered and solutions
Leetcode165 compare version number double pointer string
adobe illustrator 菜單中英文對照
Leetcode167 - sum of two numbers II - double pointer - bisection - array - Search
大文件如何快速上传?
Adobe Illustrator menu in Chinese and English
For 22 years, you didn't know the file contained vulnerabilities?
Flink datastream type system typeinformation
Introduction to dirty reading, unrepeatable reading and phantom reading
JS -- realize click Copy function
Flink DataStream 类型系统 TypeInformation