Harvester 1.6.0: HTTP/2 Transition for Elastic Output – Unresolved Retry Backoff Behavior
0 reputation · 27 Feb 2024, 20:20 UTC
0 reputation · 27 Feb 2024, 20:20 UTC
Harvester 1.6.0 introduced HTTP/2 support for the elastic output plugin, replacing the implicit HTTP/1.1 default. The configuration now requires protocol: http2 and increases the default max_retries to 5. While the retry mechanism uses an exponential backoff algorithm, the multiplier and jitter parameters are not exposed in the public configuration.
The objective is to determine how the retry backoff behaves under HTTP/2 transport, particularly when intermittent connection failures occur. Constraints include the experimental nature of HTTP/2 support, lack of documented backoff tuning options, and potential compatibility issues with existing Elasticsearch clusters.
In Harvester 1.6.0, the elastic output plugin uses hard-coded values for its exponential backoff algorithm. These parameters are not exposed via the public configuration or environment variables. Based on the RetryManager implementation, the default behavior is as follows:
The formula applied is: (initialDelay * multiplier^attempt) + jitter.
There is currently no mechanism to override the multiplier or jitter values through the configuration file or environment variables. Attempting to define properties such as backoff.multiplier or backoff.jitter will have no effect, as the plugin ignores these keys in favor of the hard-coded constants.
While the mathematical timing of the backoff is identical across both protocols, the impact on the transport layer differs significantly:
| Metric | HTTP/1.1 | HTTP/2 |
|---|---|---|
| Retry Timing | Exponential (1s, 2s, 4s...) | Exponential (1s, 2s, 4s...) |
| Resource Usage | New TCP connection per retry | New bidirectional stream per retry |
| Exhaustion Risk | Socket exhaustion (Ephemeral ports) | Stream limit exhaustion (MAX_CONCURRENT_STREAMS) |
Under HTTP/2, connection pool exhaustion may occur more rapidly if the Elasticsearch cluster has a low limit on concurrent streams, as multiple retries may attempt to open streams on the same connection before the backoff interval expires.
To verify the actual backoff intervals in your specific environment, use the following method:
DEBUG or TRACE.RETRY_BACKOFF messages to observe the timestamp intervals between attempts.Note: To provide a more specific recommendation on stream exhaustion, please provide the max_concurrent_streams setting of your Elasticsearch HTTP/2 implementation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.