Repository navigation
Let the OpenSearch worker clear its delete-by-query scrolls - #600
Merged
Merged
Conversation
Build cleanup runs _delete_by_query, which opens a scroll and clears it when the delete finishes. The worker role granted indices:data/read/scroll but not indices:data/read/scroll/clear, so every clear was denied and each scroll stayed open for its 5-minute keep-alive. Once the hourly maintenance sweep had opened 500 scrolls, the node rejected every later delete and the worker request timed out after 30 seconds. Grant both scroll actions at cluster and index level, as OpenSearch requires, and add a role-check test for a worker role that cannot clear scrolls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lexical build cleanup runs
_delete_by_query. OpenSearch opens a scroll for it and clears that scroll when the delete finishes. The rendered worker role could open the scroll but could not clear it:knowhere_worker cluster_permissions indices:data/read/scroll + indices:data/read/scroll/clear namespace index actions ... delete/byquery, delete, refresh + indices:data/read/scroll + indices:data/read/scroll/clearOpenSearch's permissions reference says both scroll actions must be granted at cluster and index level.
This PR changes the rendered role and the role check only. The live roles on the shared node are maintained by hand, so
knowhere_prod_workerandknowhere_workerneed the same actions added with the admin certificate (seedeploy/opensearch/README.md, "Two-release rehearsal and cutover"). Use a role PATCH, not PUT, because PUT replaces the whole role.Evidence
no permissions for [indices:data/read/scroll/clear]for the worker identity, followed byTrying to create too many scroll contexts. Must be less than or equal to: [500]. Node stats right after a sweep showedscroll_current: 500, and scrolls lived about 5.4 minutes on average, their full keep-alive.After: the rendered worker role grants the clear action. For a live role without it,
manage.py application-rolesnow reportscluster indices:data/read/scroll/clearand exits 1.deploy/opensearch/tests/test_operations.pypasses on Python 3.12. Ruff passes on the changed files.Merge Danger
Door: two-way
Only the rendered role definition, its tests and the README change. Reverting restores the previous rendering. The live role change is a separate operator step and can be undone with a PATCH
remove.Blast Radius: worker-role
After the live roles are updated, the worker can clear scroll contexts. It needs this action for every
_delete_by_queryit already runs. Until then, the role check reports the gap for both environments.🤖 Generated with Claude Code