Intermittently, the PTTL command returns incorrect values after setting a key with a PX (milliseconds) expiration of 500ms. The expected behavior is for PTTL to consistently return the correct time-to-live within the specified range. However, random discrepancies in PTTL values are observed. See attached video
To reproduce
redis-cli SCRIPT LOAD "$(cat mexists.txt)"
Initialize Keys:
redis-cli MSET {test} "" {test}:n "" {test}:c 0 {test}:nc 0
Run Benchmark:
redis-benchmark -n 100000 -c 100 "EVALSHA" "5830fb5ede3c8894615900ba1607a925fee4aa2b" "5" "{test}" "{test}:n" "{test}:c" "{test}:nc" "{test}:lr" "10" "500" "9372" "6854" "4336" "1818" "13678" "11160" "8642" "6124" "3606" "1088" "11637" "8367" "7811" "4541" "3985" "715" "11823" "11267" "7997" "7441" "14004" "9862" "5720" "1578" "9100" "4958" "816" "8338" "4196" "54"
Expected behavior It should show the same PTTL
Additional information https://github.com/user-attachments/assets/6d7e91a3-da55-4c01-b4ff-62e99470fc57