Skip to content

Bugfix: Disable eager loading BitSetFilterCache on Indexing Nodes #105791

Merged
JVerwolf merged 9 commits intoelastic:mainfrom
JVerwolf:bugfix/BitSetFilterCache
Mar 5, 2024
Merged

Bugfix: Disable eager loading BitSetFilterCache on Indexing Nodes #105791
JVerwolf merged 9 commits intoelastic:mainfrom
JVerwolf:bugfix/BitSetFilterCache

Conversation

@JVerwolf
Copy link
Contributor

This PR disables eager loading of the BitSetFilterCache for stateless indexing nodes.

@elasticsearchmachine elasticsearchmachine added v8.14.0 needs:triage Requires assignment of a team area label labels Feb 23, 2024
@JVerwolf JVerwolf added :Search/Search Search-related issues that do not fall into other categories >bug and removed needs:triage Requires assignment of a team area label v8.14.0 labels Feb 23, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Feb 23, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

boolean loadFiltersEagerlySetting = settings.getValue(INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING);
boolean hasIndexRole = DiscoveryNode.hasRole(settings.getNodeSettings(), DiscoveryNodeRole.INDEX_ROLE);
boolean isStateless = DiscoveryNode.isStateless(settings.getNodeSettings());
if (isStateless && hasIndexRole) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a check for stateless here. Technically, the INDEX_FAST_REFRESH_SETTING can only be set to true in stateless so this check is redundant. However, I'd rather explicitly check this requirement here so that the safety of this is not dependent on validation logic elsewhere, should the code elsewhere ever change.

}
}
}
}
Copy link
Contributor Author

@JVerwolf JVerwolf Feb 23, 2024

Choose a reason for hiding this comment

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

I spent a bunch of time working on an integration test for this to check cache warming behaviour (see this diff: https://github.com/JVerwolf/elasticsearch/compare/bugfix/BitSetFilterCache...JVerwolf:elasticsearch:bugfix/BitSetFilterCache-IT-save2?expand=1#).

However, I ran into issues updating system indices and decided it wasn't worth the effort.

@elasticsearchmachine
Copy link
Collaborator

Hi @JVerwolf, I've created a changelog YAML for you.

Copy link
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM if we move the one mostly redundant setting check into the condition :)

boolean loadFiltersEagerlySetting = settings.getValue(INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING);
boolean hasIndexRole = DiscoveryNode.hasRole(settings.getNodeSettings(), DiscoveryNodeRole.INDEX_ROLE);
boolean isStateless = DiscoveryNode.isStateless(settings.getNodeSettings());
if (isStateless && hasIndexRole) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's evaluate hasIndexRole after isStateless then I'd say :) Just so we don't pay for both checks during normal operation (not that it matters too much but still).

@JVerwolf
Copy link
Contributor Author

JVerwolf commented Mar 5, 2024

@elasticmachine update branch

@elasticsearchmachine
Copy link
Collaborator

Hi @JVerwolf, I've updated the changelog YAML for you.

@JVerwolf JVerwolf merged commit d72665a into elastic:main Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants