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

[FEATURE] forcemerge should support wait_for_completion #737

Closed
prabhupant opened this issue Apr 30, 2024 · 5 comments
Closed

[FEATURE] forcemerge should support wait_for_completion #737

prabhupant opened this issue Apr 30, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@prabhupant
Copy link

Let me know if this proposal makes sense

Is your feature request related to a problem?

forcemerge operation is quite heavy and esp if there is a large index, this operation is bound to take time. Currently, like reindex API this does not support passing wait_for_completion parameter, so there is no way to know whether the job succeeded. As we are developing scripts to maintain the index, tracking the job using the task ID will help us keep track of the job.

What solution would you like?

Add wait_for_completion query parameter which will return the task ID

What alternatives have you considered?

Currently the only alternative, I think, is to query the index stats after force refresh and compare the stats

@prabhupant prabhupant added enhancement New feature or request untriaged Need triage labels Apr 30, 2024
@dblock
Copy link
Member

dblock commented Apr 30, 2024

@prabhupant Do you have a moment to contribute this?

I see it in https://github.com/opensearch-project/opensearch-api-specification/blob/eb271e654015250b924b6e3c2f1ad0865333a19d/spec/namespaces/indices.yaml#L1275, so I imagine our generator doesn't handle these parameters? cc: @saimedhi

@saimedhi saimedhi removed the untriaged Need triage label Apr 30, 2024
@saimedhi
Copy link
Collaborator

@dblock, @prabhupant, the opensearch-py client includes a wait_for_completion parameter in the forcemerge API. You can view it here. Let me know if I missed anything. Thanks!

@dblock
Copy link
Member

dblock commented Apr 30, 2024

@prabhupant Maybe you're using an old version of the client? Can we close this?

@prabhupant
Copy link
Author

@saimedhi @dblock Thanks for pointing it out! I had an older version of the client and it wasn't available there.

Also, just one more question. I see in the OpenSearch API docs that forcemerge doesn't have wait_for_completion in query param https://opensearch.org/docs/latest/api-reference/index-apis/force-merge/#query-parameters. Using this in the request does not return a task ID like it does for reindex. Let me know if my query is wrong

Screenshot 2024-05-01 at 6 36 38 AM

@dblock
Copy link
Member

dblock commented May 1, 2024

Also, just one more question. I see in the OpenSearch API docs that forcemerge doesn't have wait_for_completion in query param https://opensearch.org/docs/latest/api-reference/index-apis/force-merge/#query-parameters. Using this in the request does not return a task ID like it does for reindex. Let me know if my query is wrong

I am not too familiar with this feature, I would do a couple of things:

  1. If there's a clear gap in documentation (this feature exists, not documented?) either contribute the doc change to https://github.com/opensearch-project/documentation-website or at least open an issue.
  2. If the feature is not behaving in a way you expect, open an issue with details in https://github.com/opensearch-project/OpenSearch. Try to explain what you get (a curl example) and what you expect to get back.

@dblock dblock closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants