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

[Backport 2.x] Remove latestSettings cache from KNNSettings #733

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 8e2ad45 from #727

Removes the latestSettings cache from the KNNSettings class.
latestSettings cache gets updated in a consumer when the particular
settings are updated.

KNNSettings.getSettingValue would pull from this cache and then fallback
to the default if it is not present. However, in the case when the
settings are set via opensearch.yml config file, the settings update
consumers never get called, so the config values never get put in the
cache. This leads to getSettingValue to always return the default
instead of the value specified in the config file.

To fix this, this change refactors getSettingValue to pull from the
cluster settings and removes the latestSetting cache. However, because
the dynamicCacheSettings have consumers that rebuild the
NativeMemoryCacheManager cache when they are changed, the logic for
passing the parameters to rebuild this cache had to change as well.

Also, switches configuration of cache manager to use DTO.

Signed-off-by: John Mazanec <[email protected]>
(cherry picked from commit 8e2ad45)
@opensearch-trigger-bot opensearch-trigger-bot bot requested a review from a team January 19, 2023 17:22
@jmazanec15 jmazanec15 merged commit ed147f0 into 2.x Jan 19, 2023
@github-actions github-actions bot deleted the backport/backport-727-to-2.x branch January 19, 2023 17:52
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