From c8f16a376913018ee07d13ad39d4554f048047a0 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 25 Mar 2022 16:25:20 +0900 Subject: [PATCH] Fix wrong description of total retry time See also: https://github.com/fluent/fluentd/pull/3649 Before the fix and https://github.com/fluent/fluentd/pull/3640 , the both of retry behavior and the document were wrong. Actual behavior: `c + c + cb^1 + ... + cb^(k-1)` (k+1 retries totally) Total calculation: `cb^(-1) + c + cb^1 + ... + cb^(k-2)` Signed-off-by: Daijiro Fukuda --- buffer/README.md | 2 +- configuration/buffer-section.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/buffer/README.md b/buffer/README.md index b46fa687..a33f47f8 100644 --- a/buffer/README.md +++ b/buffer/README.md @@ -41,7 +41,7 @@ A chunk can fail to be written out to the destination for a number of reasons. T By default, Fluentd increases the wait interval exponentially for each retry attempt. For example, assuming that the initial wait interval is set to 1 second and the exponential factor is 2, each attempt occurs at the following time points: ```text -1 2 4 8 16 +0 1 3 7 15 x-x---x-------x---------------x------------------------- │ │ │ │ └─ 4th retry (wait = 8s) │ │ │ └───────────────── 3th retry (wait = 4s) diff --git a/configuration/buffer-section.md b/configuration/buffer-section.md index b33f90fc..6da89cb5 100644 --- a/configuration/buffer-section.md +++ b/configuration/buffer-section.md @@ -546,7 +546,8 @@ With `exponential_backoff`, `retry_wait` interval will be calculated as below: * c: constant factor, `@retry_wait` * b: base factor, `@retry_exponential_backoff_base` * k: number of retry times -* total retry time: `c + c * b^1 + (...) + c*b^k = c*b^(k+1) - 1` +* total retry time: `c + c*b^1 + (...) + c*b^(k-1) = c*(b^k - 1) / (b - 1)` + * = `2^k - 1` by default If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.