dice icon indicating copy to clipboard operation
dice copied to clipboard

Fixes inconsistent EXPIRE when ran with flags XX, LT-XX and GT on a key without ttl

Open jainam2907 opened this issue 1 year ago • 1 comments

closes #509 #508 #507

jainam2907 avatar Sep 09 '24 01:09 jainam2907

RCA: The EXPIRE command correctly returned 0 or 1 based on whether it should set the expiration for a key, but it still unconditionally set the expiration regardless of the return value, which caused the errors.

Resolution: I have fixed this issue by ensuring the expiration is updated conditionally, based on the flags passed and the existing expiration of the key. Additionally, I updated the integration tests to include a call to the TTL command to verify that the expiration is accurate, alongside the response code returned by the previous EXPIRE command.

The attached output of the tcl test confirms the behavior is correct now. tcltest-output.log

jainam2907 avatar Sep 10 '24 05:09 jainam2907

Thanks for the fixes @jainam2907! Thanks for the reviews @lucifercr07.

JyotinderSingh avatar Sep 10 '24 14:09 JyotinderSingh