dice icon indicating copy to clipboard operation
dice copied to clipboard

Inconsistent `EXPIRE`: EXPIRE with big integer overflows when converted to milliseconds

Open lucifercr07 opened this issue 1 year ago • 10 comments

Steps to reproduce

Run the commands mentioned in the test on Line 110 in the file https://github.com/AshwinKul28/dice-tests/blob/main/tcltests/unit/expire.tcl#L110.

Expected output

The expected output when the above set of commands when run on Redis

Expected an error matching 'ERR invalid expire time in 'expire' command' but got '1' (context: type eval line 5 cmd {assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966}} proc ::test)

Observed output

The observed output when the above set of commands when run on DiceDB

Expected an error matching 'ERR invalid expire time in 'expire' command' but got '1' (context: type eval line 5 cmd {assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966}} proc ::test)

The steps to run the test cases are mentioned in the README of the dice-tests repository.

Expectations for resolution

This issue will be considered resolved when the following things are done:

  1. Changes in the dice repository code to meet the expected behavior.
  2. Successful run of the tcl test behavior.

You can find the tests under the tests directory of the dice repository and the steps to run are in the README file. Refer to the following links to set up DiceDB and Redis 7.2.5 locally

lucifercr07 avatar Sep 20 '24 18:09 lucifercr07

@lucifercr07 of please assign me this one also as i will cover in issue #671

Thanks!!

Abh-ay avatar Sep 20 '24 19:09 Abh-ay

@Abh-ay Thanks for picking this up. Assigned

AshwinKul28 avatar Sep 20 '24 21:09 AshwinKul28

Hi @AshwinKul28 @lucifercr07 we are getting unexpected output due to assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966} and we set max value for expiry is 9223372036854775 in dice-db and for this command redis behaviour put below image So should we need to ignore it or change value in dice-test?

Abh-ay avatar Sep 22 '24 04:09 Abh-ay

@Abh-ay This was changed recently. Ideally, if we are not setting up an expiry time and returning 1 is not good behavior I feel.

So we have two options, keep it consistent as per our behaviour or make it consistent with redis.

To make sure it is consistent with the redis, we can ignore if the value is greater than 9223372036854775 and return 1 as a response but actually, it doesn't set the value. (I feel this is misguided)

what do you think? @lucifercr07

AshwinKul28 avatar Sep 22 '24 11:09 AshwinKul28

Yes @AshwinKul28 bit confused behaviour of redis, for now I think we are running properly for this expire value. If we are getting expire value greater than 9223372036854775 then return an error and getting smaller then we return 1. If we keep it consistent as per our behaviour then we have to make changes in dice-test. @lucifercr07 Should i raise PR for dice-test repo or need to change in dice for handling this cases.

Abh-ay avatar Sep 22 '24 11:09 Abh-ay

You can raise a PR in the dice-repo, link this issue there. we will review it. Thanks @Abh-ay

AshwinKul28 avatar Sep 24 '24 18:09 AshwinKul28

Hi @AshwinKul28 @lucifercr07 Please have a look into this PR. https://github.com/AshwinKul28/dice-tests/pull/10

Abh-ay avatar Sep 29 '24 20:09 Abh-ay

Hello @Abh-ay,

There has been no activity on this issue for the past 5 days. It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

arpitbbhayani avatar Oct 09 '24 02:10 arpitbbhayani

Hi @arpitbbhayani for now I think we are running properly for this expire value. If we are getting expire value greater than 9223372036854775 then return an error and if provided value is smaller then we return 1 as a success response. And for that I already raised PR for dice-test in which I modified testcase you can visit https://github.com/AshwinKul28/dice-tests/pull/10 @AshwinKul28 @lucifercr07 Can you please review this PR and update?

Abh-ay avatar Oct 09 '24 14:10 Abh-ay

Hello @Abh-ay,

There has been no activity on this issue for the past 5 days. It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

arpitbbhayani avatar Oct 24 '24 13:10 arpitbbhayani