Redis - keys disappear

Is it possible for keys to disappear in Redis for no reason? I add keys to redis:

Transaction transaction = jedis.multi();
transaction.incrBy(positionsQuantityKey, positionQuantity);
transaction.expire(positionsQuantityKey, 24 * 3600);
transaction.exec();

      

but after a few minutes I ran the command:

jedis.keys("*");

      

and the key disappeared. What can remove this key? I'm pretty sure the expiration time was set successfully because the result of this command was 1.

I am using redis 2.6

+3


source to share


1 answer


If you are not doing anything with Redis during this time, open a session MONITOR

with redis-cli and see what happens - another process might delete your key.



Alternatively, you may be running low on RAM and your Redis shutdown policy is set to preempt volatile keys.

+6


source







All Articles