opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.7k stars 1.8k forks source link

Add a backoff time field to _bulk requests response #11289

Open priyatsh opened 11 months ago

priyatsh commented 11 months ago

Is your feature request related to a problem? Please describe. In some of the tests for ingestion, we want to re-trigger bulk requests for some re-triable errors with a backoff(based on the failure). In order to retry bulk requests with backoff time, we need additional field backoff time in the response from the server so that the client can re-trigger the bulk request in case of a re-triable error after the appropriate backoff time.

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

dhwanilpatel commented 11 months ago

Ideally client should decide the backoff time based on retry strategy, client may need to retry with fix delay/exponential delay/other strategy.

Can you please share more details on why it needs to be returned from server?

dblock commented 11 months ago

This is a nice to have feature if the server knows for sure that retrying an API will fail in the next N time. It's pretty common for systems that do rate limiting, but it's not as common in systems that have load-based circuit breakers. Does OpenSearch have useful information for the client about when it's best to retry a bulk operation?