[
https://issues.apache.org/jira/browse/IOTDB-2907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529490#comment-17529490
]
Jack Tsai commented on IOTDB-2907:
----------------------------------
[~qiaojialin] OK, cool. So I now have a rough idea. How about registering a
global cache manager to RegisterManager from the beginning right after the
IoTDB starts? And once a storage group has been added, we could make a
registration to the cache manager. Maybe we could design a cache like:
{code:java}
Map<String sgName, List<Cache> cachesInSg>
{code}
> Improve cache management
> ------------------------
>
> Key: IOTDB-2907
> URL: https://issues.apache.org/jira/browse/IOTDB-2907
> Project: Apache IoTDB
> Issue Type: Improvement
> Reporter: Jialin Qiao
> Priority: Minor
>
> Currently, we have TimeseriesMetadataCache, ChunkMetadataCache, ChunkCache,
> and BloomFilterCache.
> These caches usually bind cached entries with specified TsFiles.
> When deleting and recreating the storage group, the version of TsFile is
> reused, which may cause a cached entry inconsistent with data on the disk,
> thus causing bugs in the query.
>
> A potential solution:
> We need to manage all caches in system by an ICache interface containing
> clearWhenDeleteSG(String sgName). When adding a cache, it should implement
> ICache and register in the system. Then, deleting storage group could remove
> all registered Cache.
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)