We need to check if an element is eternal when setting TTL for the set of known keys. Otherwise we'd expire the_ZSET_ immediately which breaks Cache.clear since we do not know about the eternal key any more.
protectedvoidmaintainKnownKeys(RedisCacheElementelement, RedisConnectionconnection) {
if (!element.hasKeyPrefix()) {
connection.zAdd(cacheMetadata.getSetOfKnownKeysKey(), 0, element.getKeyBytes());
if (!element.isEternal()) {
connection.expire(cacheMetadata.getSetOfKnownKeysKey(), element.getTimeToLive());
}
}
}
Christoph Strobl opened DATAREDIS-402 and commented
We need to check if an element is eternal when setting TTL for the set of known keys. Otherwise we'd expire the_ZSET_ immediately which breaks
Cache.clear
since we do not know about the eternal key any more.Affects: 1.5 GA (Fowler)
Referenced from: pull request #141
Backported to: 1.5.1 (Fowler SR1)
The text was updated successfully, but these errors were encountered: