Open arbha1erao opened 2 months ago
Hi @arpitbbhayani I would like to work on this issue.
I came across this issue while working on https://github.com/DiceDB/dice/issues/378
cc: @JyotinderSingh
@swarajrb7 go for it. Thanks for picking it up!
Few more additions to this -
This is occurring with SET command as well.
# On DiceDB
127.0.0.1:7379> SET "\x00\x01" "value"
OK
127.0.0.1:7379> get "\x00\x01"
"value"
127.0.0.1:7379> get \x00\x01
"value"
# On Redis
127.0.0.1:6379> SET "\x00\x01" "value"
OK
127.0.0.1:6379> get "\x00\x01"
"value"
127.0.0.1:6379> get \x00\x01
(nil)
In Redis, the key is treated as a binary-safe string, while DiceDB seems to be interpreting unquoted binary sequences as valid keys, leading to the discrepancy. Redis used RESP(Redis Serialization Protocol). In RESP, strings are represented as a $ character, followed by the length of the string in decimal format, followed by \r\n. The string itself can contain arbitrary characters including \0, \r and \n and can hence be used to represent binary blobs
Hello might not be able to work on this. Can we un-assign me so that we have someone else pick this up for now? @arpitbbhayani / @AshwinKul28
@AshwinKul28 - I can pick this up.
Could not able to reproduce this in the master branch as of today.
@btalukdar511, I am still able to reproduce.
Hi @arpitbbhayani can i take this up
@Aditya-Bhalerao @arpitbbhayani can you please assign this to me
The command
MSET
is not consistent with Redis implementation. Here are the steps to reproduce the issueExecute Command - MSET key value (Where key is an binary data) Excute Command - GET key
Here's the output I observed in Redis v7.2.5
and here's the output I observed in DiceDB's latest commit of the
master
branch(Observe the value printed by GET in absense of double-quotes)
To summarize -
Make the implementation consistent with the Redis implementation. Make sure you are using Redis version 7.2.5 as a reference for the command implementation and to setup Redis