Redis - Expired Indexes are not deleted

巧了我就是萌 提交于 2019-12-24 20:17:26

问题


I found the following question (Spring Redis - Indexes not deleted after main entry expires) about a problem with expiration of indexes in Redis.

The problem is that the main and :phantom entries expire and are being deleted correctly, but the corresponding :idx entries survive orphaned in Redis.

One of the proposed solutions was to enable KeyspaceEvents, so that Redis automatically removes indexes of expired entries during the cleanup job.

Unfortunately this solution will not work for our Spring Boot application, as we are using Redis Enterprise as a provided service inside a cloud environment, which does not allow us to make any configuration changes (CONFIG command is disabled).

Here what I tried:

@Configuration
@EnableRedisRepositories(enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP)
public class RedisConfiguration {...}

Edit:
I thought this was working for my local Redis docker image, but I was wrong! And on our provided Redis (Enterprise) service it can't even be setup with the following message:
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CONFIG'...

Can anybody give me a hint on how to get the indexes deleted?

We currently do not have many :idx entries, but they must/should be deleted together with the :phantom entry, to avoid keeping any 'orphaned' entries.

Thanks in advance.

来源:https://stackoverflow.com/questions/48379229/redis-expired-indexes-are-not-deleted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!