当前位置:网站首页>Collation of errors encountered in the use of redis shake
Collation of errors encountered in the use of redis shake
2022-04-23 15:12:00 【Heavy dust】
Catalog
redis-shake Sort out the errors encountered in use
This article records , I'm using redis-shake Some mistakes encountered
redis-shake decode Error testing
Running redis-shake Of decode The following error occurred during mode , But Baidu and Google can't find the answer , error message :
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
From the error information , Is in github.com/alibaba/RedisShake/redis-shake/common/utils.go
953 Error in line code , But also io Error reading file
This mistake is very strange , Why read rdb File error ? Because of my rdb The file is running redis-shake Of dump The pattern gets
At this time, the author thought redis-shake It's open source. , Pull the official source code for testing , Here is the handle. decode Part of the code is simplified , It's not a complete process , Just go to the wrong place
Sort out the process of file reading , From run redis-shake Pull this from your machine rdb File to test
When I cut out the code , Re running go Program , It was found that there was no error , Read the file normally ; And then again in redis-shake Running on the machine decode Pattern , It's normal
It's really hard to cry or laugh , But later I thought about the reasons for this problem , It should be this rdb File format problem
Because the author later tested rdb The file is actually rerun dump New file generated by pattern , In the beginning rdb The file was generated the day before and run many times dump Covered , May cause some problems
Conclusion
redis-shake Generated rdb Try not to overwrite the file multiple times , It's best to rename each time
Author code
https://github.com/MoGD2018/go-study/tree/main/go-redis-shake-decode
版权声明
本文为[Heavy dust]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231507564800.html
边栏推荐
- Async keyword
- Redis master-slave synchronization
- 博睿数据携手F5共同构建金融科技从代码到用户的全数据链DNA
- Detailed analysis of SQL combat of Niuke database (26-30)
- The wechat applet optimizes the native request through the promise of ES6
- Example of time complexity calculation
- My raspberry PI zero 2W toss notes to record some problems and solutions
- Async void caused the program to crash
- LeetCode149-直线上最多的点数-数学-哈希表
- C语言超全学习路线(收藏让你少走弯路)
猜你喜欢
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
LeetCode165-比较版本号-双指针-字符串
Detailed explanation of C language knowledge points - data types and variables [2] - integer variables and constants [1]
大文件如何快速上传?
Set onedrive or Google drive as a drawing bed in upic for free
Reptile exercises (1)
每日一题-LeetCode396-旋转函数-递推
Redis主从同步
中富金石财富班29800效果如何?与专业投资者同行让投资更简单
eolink 如何助力远程办公
随机推荐
The difference between having and where in SQL
thinkphp5+数据大屏展示效果
My raspberry PI zero 2W tossing notes record some problems encountered and solutions
Share 20 tips for ES6 that should not be missed
[thymeleaf] handle null values and use safe operators
js——实现点击复制功能
eolink 如何助力遠程辦公
LeetCode167-两数之和II-双指针-二分-数组-查找
每日一题-LeetCode396-旋转函数-递推
Nuxt project: Global get process Env information
Basic operation of circular queue (Experiment)
Leetcode165 compare version number double pointer string
adobe illustrator 菜單中英文對照
[proteus simulation] automatic range (range < 10V) switching digital voltmeter
Baidu written test 2022.4.12 + programming topic: simple integer problem
nuxt项目:全局获取process.env信息
Explanation and example application of the principle of logistic regression in machine learning
JS -- realize click Copy function
How to write the keywords in the cover and title? As we media, why is there no video playback
Will golang share data with fragment append