[Improvement] cannot disable catalog cache
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 935
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 298
Description
### What would you like to be improved?
Currently, the catalog cache is specific to a single Gravitino instance. When using a multi-instance deployment in a cluster, if we want to maintain strong data consistency, we need to disable the catalog cache. However, there is only one configuration item that can be set: `gravitino.catalog.cache.evictionIntervalMs`. Setting this value to `0` disables the cache, causing it to be evicted immediately. As a result, the classLoader of the catalog is closed, leading to a `ClassNotFoundException` during subsequent operations on that catalog.
relative codes:
cache conf:
https://github.com/apache/gravitino/blob/aee3290eb05dcf74a8bd8cd0c3b2a4d6759f2ddf/conf/gravitino.conf.template#L58-L60
cache eviction close the catalog:
https://github.com/apache/gravitino/blob/fd221a33833b4f50c74ff699f89107692023ef2d/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java#L300-L316
catalogWrapper close the classLoader:
https://github.com/apache/gravitino/blob/fd221a33833b4f50c74ff699f89107692023ef2d/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java#L237-L252
### How should we improve?
Adding configuration `gravitino.catalog.cache.enable` allows the cache to be manually disabled
Contributor guide
Assessment
This issue has not been assessed yet.