[X] I had searched in the issues and found no similar issues.
Version
2.9.0
Minimal reproduce step
127.0.0.1:6666> set k -1
OK
127.0.0.1:6666> get k
"-1"
127.0.0.1:6666> dump k
"\x00\xc0\xff\x06\x00\x9a~\x16\xa4p]\xa1V"
127.0.0.1:6666> restore k1 0 "\x00\xc0\xff\x06\x00\x9a~\x16\xa4p]\xa1V"
OK
127.0.0.1:6666> get k1
"255"
127.0.0.1:6666> get k
"-1"
127.0.0.1:6666> set k2 -2
OK
127.0.0.1:6666> get k2
"-2"
127.0.0.1:6666> dump k2
"\x00\xc0\xfe\x06\x00$FVjY\x0c\xb3\xa2"
127.0.0.1:6666> restore k22 0 "\x00\xc0\xfe\x06\x00$FVjY\x0c\xb3\xa2"
OK
127.0.0.1:6666> get k2
"-2"
127.0.0.1:6666> get k22
"254"
What did you expect to see?
The value remains negative after RESTORE.
What did you see instead?
when restoring dumped negative integers, the values are restored as positive numbers (255 for -1 and 254 for -2).
Search before asking
Version
2.9.0
Minimal reproduce step
What did you expect to see?
The value remains negative after RESTORE.
What did you see instead?
when restoring dumped negative integers, the values are restored as positive numbers (255 for -1 and 254 for -2).
Anything Else?
Possibly a problem with the following code?
https://github.com/apache/kvrocks/blob/2a0c57ac7fc4499a210bc452884025a0010cb470/src/storage/rdb.cc#L158-L160
Are you willing to submit a PR?