Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 10 报错 #28

Closed
tanjiaxi opened this issue Jan 16, 2024 · 13 comments
Closed

version 10 报错 #28

tanjiaxi opened this issue Jan 16, 2024 · 13 comments

Comments

@tanjiaxi
Copy link

Got a connection, launched process /Users/t/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___go_build_github_com_hdt3213_rdb (pid = 5053).
error: cursor out of range
Exiting.

@tanjiaxi
Copy link
Author

rbd 版本是10

@HDT3213
Copy link
Owner

HDT3213 commented Jan 19, 2024

可以提供 rdb 文件或更多信息吗?

@tanjiaxi
Copy link
Author

tanjiaxi commented Jan 19, 2024

redis 7.0.7 list使用gizp的时候,他的rdb文件的Entry 结尾不是按照文档上面的。170 = {uint8} 199
171 = {uint8} 253
172 = {uint8} 235
173 = {uint8} 0
174 = {uint8} 0
175 = {uint8} 0
176 = {uint8} 1
177 = {uint8} 170
178 = {uint8} 224
这里的176 是length 了,表示结束了,但是170才是实际的length,但是176为1,就表示结束了
不是这个问题,我解决了,但是后面还遇到一个问题,正在,,,,。也是list 的zip的情况

@tanjiaxi
Copy link
Author

tanjiaxi commented Jan 19, 2024 via email

@HDT3213
Copy link
Owner

HDT3213 commented Jan 19, 2024

放附件里吧 hdt3213@outlook.com

@HDT3213
Copy link
Owner

HDT3213 commented Jan 19, 2024

redis 7.0.7 list使用gizp的时候,他的rdb文件的Entry 结尾不是按照文档上面的。170 = {uint8} 199 171 = {uint8} 253 172 = {uint8} 235 173 = {uint8} 0 174 = {uint8} 0 175 = {uint8} 0 176 = {uint8} 1 177 = {uint8} 170 178 = {uint8} 224 这里的176 是length 了,表示结束了,但是170才是实际的length,但是176为1,就表示结束了 不是这个问题,我解决了,但是后面还遇到一个问题,正在,,,,。也是list 的zip的情况

gizp? 是说 list 的编码是 ziplist 吗?

@tanjiaxi
Copy link
Author

tanjiaxi commented Jan 19, 2024 via email

@tanjiaxi
Copy link
Author

放附件里吧 hdt3213@outlook.com

稍后整理一个

@tanjiaxi
Copy link
Author

放附件里吧 hdt3213@outlook.com

稍后整理一个

发你邮箱啦

@HDT3213
Copy link
Owner

HDT3213 commented Jan 22, 2024

收到

@tanjiaxi
Copy link
Author

func readVarInt(cursor *int, l uint16) uint32 {
realLen := l + 2 //比数据大于两个长度
byteLen := lpEncodeBackLen(int(realLen)) //
*cursor += byteLen
return uint32(realLen) //或者根据byteLen实际情况解析,从右往左解析
}

func lpEncodeBackLen(l int) int {
if l <= 127 {
return 1
} else if l < 16383 { //2^{14} - 1
return 2
} else if l < 2097151 { //2^{21} - 1
return 3
} else if l < 268435455 { // 2^{28} - 1
return 4
} else {
return 5
}
}
这里可以这样呢。我看源码他是需要从右往左解析的,而我们现在是从左往右解析的。所有优点问题

@HDT3213
Copy link
Owner

HDT3213 commented Jan 25, 2024

已经解析成功了,等我晚上发个包

@HDT3213
Copy link
Owner

HDT3213 commented Jan 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants