5

Is it possible to disappear keys in Redis without reason? I'm adding keys to redis:

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

but after few minutes I ran command:

jedis.keys("*");

and the key disappeared. What could delete this key? I'm sure that expire time was succesfully set, because result of this command was 1.

I'm using redis 2.6

1 Answer 1

7

If you're not doing anything else with Redis during that time, open a MONITOR session with redis-cli and look what goes on - another process could be deleting your key.

Alternatively, perhaps you're running low on RAM and Redis' eviction policy is configured to evict volatile keys.

1
  • Yes, there was a problem with key eviction due to low RAM.
    – Toma
    Feb 2, 2016 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.