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

zset score key comparator bug about version comparison #2338

Closed
wangshao1 opened this issue Jan 22, 2024 · 5 comments
Closed

zset score key comparator bug about version comparison #2338

wangshao1 opened this issue Jan 22, 2024 · 5 comments
Assignees
Labels
3.5.3 ☢️ Bug Something isn't working

Comments

@wangshao1
Copy link
Collaborator

Is this a regression?

Yes

Description

blackwidow中int类型值使用小端存到RocksDB,这种方式就无法按照字典序对version进行排序。
ZSetsScoreKeyComparatorImpl中是将pkey和version统一作为前缀进行了比较,这种方式比对的version是错误的,可能导致遍历出额外的数据。
如果int类型存储仍然是小端的方式,那应该将version decode出来,比对int值,而不是按照字典序比对。

Please provide a link to a minimal reproduction of the bug

No response

Screenshots or videos

images

Please provide the version you discovered this bug in (check about page for version information)

No response

Anything else?

No response

@fancy-rabbit
Copy link
Collaborator

It looks like the screenshot is not visible...

@wangshao1
Copy link
Collaborator Author

It looks like the screenshot is not visible...

actually i didn't post any screenshot in this issue description, you can see the unit test i added in the relevant PR which previous implementation will fail.

@wanghenshui
Copy link
Collaborator

改动会不会影响存量数据等排序?

@wangshao1
Copy link
Collaborator Author

改动会不会影响存量数据等排序?

我理解是只对于同一个pkey下的zset,而且存量数据是两个不同的version的排序会有影响,其他情况不会有影响。

@wanghenshui
Copy link
Collaborator

改动会不会影响存量数据等排序?

我理解是只对于同一个pkey下的zset,而且存量数据是两个不同的version的排序会有影响,其他情况不会有影响。

你说的对。只有频繁修改的某一个key的version会乱序

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.5.3 ☢️ Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants