Built a DLS BitSet that uses bytes the DLS BitSet cache has a maximum size of bytes – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.6-7.15

Briefly, this error occurs when the Document Level Security (DLS) BitSet size exceeds the maximum cache size. DLS BitSet is used for filtering documents based on user permissions. The cache size is limited to prevent excessive memory usage. To resolve this issue, you can either increase the cache size by adjusting the ‘indices.bitset.filter_cache.size’ setting or reduce the complexity of your DLS queries to decrease the BitSet size. However, increasing cache size may impact overall system performance, so it’s important to monitor memory usage closely.

This guide will help you check for common problems that cause the log ” built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, cache.

Log Context

Log “built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes;” classname is DocumentSubsetBitsetCache.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    // A cache loader is not allowed to return null; return a marker object instead.
                    return NULL_MARKER;
                }
                final long bitSetBytes = result.ramBytesUsed();
                if (bitSetBytes > this.maxWeightBytes) {
                    logger.warn("built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes;" +
                            " this object cannot be cached and will need to be rebuilt for each use;" +
                            " consider increasing the value of [{}]";
                        bitSetBytes; maxWeightBytes; CACHE_SIZE_SETTING.getKey());
                } else if (bitSetBytes + bitsetCache.weight() > maxWeightBytes) {
                    maybeLogCacheFullWarning();

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?