当前位置:网站首页>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
边栏推荐
- LeetCode165-比较版本号-双指针-字符串
- Five data types of redis
- Is asemi ultrafast recovery diode interchangeable with Schottky diode
- Llvm - generate for loop
- JUC学习记录(2022.4.22)
- LeetCode151-颠倒字符串中的单词-字符串-模拟
- Detailed explanation of C language knowledge points -- first understanding of C language [1] - vs2022 debugging skills and code practice [1]
- Introduction to Arduino for esp8266 serial port function
- JS - implémenter la fonction de copie par clic
- 8.5 concise implementation of cyclic neural network
猜你喜欢

LeetCode149-直线上最多的点数-数学-哈希表

博睿数据携手F5共同构建金融科技从代码到用户的全数据链DNA

Swift protocol Association object resource name management multithreading GCD delay once

每日一题-LeetCode396-旋转函数-递推

Lotus DB design and Implementation - 1 Basic Concepts

分布式事务Seata介绍

Introduction to Arduino for esp8266 serial port function

Swift - literal, literal protocol, conversion between basic data types and dictionary / array

Daily question - leetcode396 - rotation function - recursion

Leetcode153 - find the minimum value in the rotation sort array - array - binary search
随机推荐
大文件如何快速上传?
Basic operation of sequential stack
On the day of entry, I cried (mushroom street was laid off and fought for seven months to win the offer)
[proteus simulation] automatic range (range < 10V) switching digital voltmeter
Is asemi ultrafast recovery diode interchangeable with Schottky diode
中富金石财富班29800效果如何?与专业投资者同行让投资更简单
What is the effect of Zhongfu Jinshi wealth class 29800? Walk with professional investors to make investment easier
8.2 text preprocessing
Ffmpeg installation error: NASM / yasm not found or too old Use --disable-x86asm for a clipped build
LeetCode149-直线上最多的点数-数学-哈希表
PSYNC synchronization of redis source code analysis
Async void caused the program to crash
Practice of unified storage technology of oppo data Lake
TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
adobe illustrator 菜單中英文對照
setcontext getcontext makecontext swapcontext
Flink DataStream 类型系统 TypeInformation
Llvm - generate for loop
Lotus DB design and Implementation - 1 Basic Concepts
LeetCode167-两数之和II-双指针-二分-数组-查找