Describe the bug
Redis config has a max memory limit set and no-eviction policy. If the memory is > the max memory, calling a Lua script containing redis.call('del', 'anything') before redis.call('set', 'fo', 'bar') doesn't result in an OOM error, and the key is created.
To reproduce
Set the following config in Redis.conf
maxmemory 1mb
maxmemory-policy noeviction
Run a script to that will call a Lua script repeatedly, using a new key each time, until the error returned is OOM.
Lua script:
redis.call('set',{some key}, '1')
Now run the following:
redis.call('del', 'anything')
redis.call('set',{some key}, '1')
Expected behavior
When the second Lua script is run that includes the deletion of a random key, it should still return an OOM error.
Additional information
Tried on Redis server versions:
5.0.6 and 6.0.0