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
fix wrong data type conversion in zrangeResultBeginStore #13148
Conversation
@enjoy-binbin Hi, could you please help review this PR? Thanks a lot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please add a comment in zsetTypeCreate
to mention the -1
thing, and please also try to find a place to add a test:
zadd src 1 a
zrangestore dst src 0 -1
assert_encoding listpack dst
please also merge upstream/unstable to solve the failing CI
@enjoy-binbin Sorry, I made a mistake in the top comment. This bug can be triggered when the source of I add the tests for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks.
@oranagra the impact of this is that some dst keys will be converted to use skiplist
In
beginResultEmission
, -1 means the result length is not known in advance. But after #12185, if we pass -1 tozrangeResultBeginStore
, it will convert to SIZE_MAX inzsetTypeCreate
and try todictExpand
. AlthoughdictExpand
won't succeed because the size overflows, I think we'd better to avoid this wrong conversion.This bug can be triggered when the source of
zrangestore
doesn't exist or we usezrangestore
command withbyscore
orbylex
.The impact is that dst keys will be converted to use skiplist instead of listpack.