Skip to content
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

Modified BlockCacheManager to not create caches when size is zero. #5369

Open
wants to merge 1 commit into
base: 2.1
Choose a base branch
from

Conversation

dlmarion
Copy link
Contributor

No description provided.

@dlmarion dlmarion added this to the 2.1.4 milestone Feb 28, 2025
@dlmarion dlmarion self-assigned this Feb 28, 2025
@dlmarion
Copy link
Contributor Author

I found this while working on #5302. I added a data block cache to the Compactor, but not index and summary caches. I noticed in the log that these caches were still being created.

BlockCache cache = this.createCache(conf, type);
this.caches.put(type, cache);
if (conf.getMaxSize(type) > 0) {
BlockCache cache = this.createCache(conf, type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this change could cause a NPE in the following code when it calls getMaxHeapSize on a cache if its null.

_iCache = cacheManager.getBlockCache(CacheType.INDEX);
_dCache = cacheManager.getBlockCache(CacheType.DATA);
_sCache = cacheManager.getBlockCache(CacheType.SUMMARY);
long dCacheSize = _dCache.getMaxHeapSize();
long iCacheSize = _iCache.getMaxHeapSize();
long sCacheSize = _sCache.getMaxHeapSize();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants