-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement]: Remove vector data when the corresponding cache data expires in cache storage #632
Comments
I don't recommend cleaning data here, because when data becomes invalid using the evict strategy, all data will be deleted, including scalars and vectors. |
Thank you for the suggestion. After using the Redis evict strategy, I have another question: seems like there is a "deleted" field in eviction base, which eviction_manager.soft_evict() method will mark as -1, then eviction_manager.delete() method will permanently remove soft-evicted data from both scalar&vector store. |
@Laarryliu For the relationship between eviction manager and evict base, you can refer to this https://github.com/zilliztech/GPTCache/blob/main/gptcache/manager/data_manager.py#L236. In fact, we have abstracted the evict base here, and the eviction manager deletion does not actually care about the strategy. If you can, please help me create the pr when you have free time. |
Do you mean that if I init a SSDataManager with a RedisCacheEviction(or other implementations), an on_evict attribute should be init with _clear() method? |
yes |
Hi @Laarryliu @SimFG Do we have any update on this issue? Any clarity on how Redis should interaction with EvictionBase and EvictionManager Instead would be appreciated and wondering if there's any PR for this soon? |
@ykzeng There is no update yet, if I have time this week I will fix it. |
@ykzeng What is the problem you are facing now? I looked at it and it seems that there are some doubts about the current implementation of redis. There seems to be no callback function after the data expires. |
What would you like to be added?
In adapter.py line 108, when trying to search for data in cache store according to vector data:
here,
if cache_data is None
means no data in cache store could be found with data from vector store.Is it better to remove the corresponding data from vector store to avoid hit it again?
Why is this needed?
Since the data in cache store is no longer available (maybe due to a cache ttl strategy, etc.), removing vector data is necessary so that the expired cache data will no longer be accessed.
Anything else?
Please correct me if I missed some details
The text was updated successfully, but these errors were encountered: