Report inconsistency in the command `TTL`
This issue is all about ensuring we are as close to Redis as possible. The command in focus for this issue is TTL.
Go through the official documentation of the command TTL on Redis and identify the inconsistencies. The inconsistencies could be in
- unhandled edge case
- unexpected behavior
- unsupported option
Because we are trying to be compatible with Redis v7.2.5, I would recommend you try out different variants of the command with different inputs on that specific version. The instructions on running Redis v7.2.5 locally
Once you find the discrepancy, you can either
- raise an issue on Dice repository with details, or
- try to fix it yourself and raise a PR
If you are raising the issue, make sure you provide the details such as
- use the template and provide the following details
- steps to reproduce (series of commands)
- observed output on DiceDB
- observed output on Redis v7.2.5
Also, feel free to update the documentation and raise the PR in the docs repository.
You will need to go deeper into the command make sure you are covering all cases and reporting the inconsistencies or fixing them. The deeper the work, the better our stability will be. Also, it is possible that we do not find any discrepancies, so please mention the same in the comment on this issue. Mention the PR or issue links that you create under this issue.
Shall i take this up?
@VipinRaiP Go for it. Thanks a ton :) Assigned the issue to you.
Verified following cases and it's working as expected.
- Key without expiry set returns -1.
- Key with expiry set it returns the time left in seconds. Once key gets expired it returns -2.
- Key which its not present it returns -2.
cc : @arpitbbhayani
As per @VipinRaiP findings, looks like we are consistent with the Redis. Closing the issue. Thanks a ton, @VipinRaiP