From f19eb7de88b27a5476e202affe36d1bf1f028f98 Mon Sep 17 00:00:00 2001
From: Doug Szumski <doug@stackhpc.com>
Date: Thu, 20 Jun 2019 08:22:00 +0000
Subject: [PATCH] Disable Fluentd Monasca plugin retry limit

By default a retry limit of 17 exists. When the limit is reached buffered
logs are discarded. To avoid this, we disable the retry limit. The risk of
bringing down the host by filling the Fluent data docker volume is managed
by the maximum buffer size which is 2GB by default.

In summary, after this change, the net behaviour is that Fluentd should
buffer up to a maximum of 2GB of logs locally, and attept to post them to
the Monasca Log API at intervals not exceeding 30 minutes.

Closes-Bug: #1855702
Change-Id: I0d5a3dab29635c00411f4f51e5a0721726df2abd
---
 ansible/roles/common/templates/conf/output/00-local.conf.j2   | 2 ++
 ansible/roles/common/templates/conf/output/02-monasca.conf.j2 | 1 +
 2 files changed, 3 insertions(+)

diff --git a/ansible/roles/common/templates/conf/output/00-local.conf.j2 b/ansible/roles/common/templates/conf/output/00-local.conf.j2
index 22597cb40..7a13196a7 100644
--- a/ansible/roles/common/templates/conf/output/00-local.conf.j2
+++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2
@@ -43,6 +43,7 @@
        buffer_type file
        buffer_path /var/lib/fluentd/data/monasca.buffer/{{ syslog_swift_facility }}.*
        max_retry_wait 1800s
+       disable_retry_limit true
     </store>
 {% endif %}
 </match>
@@ -94,6 +95,7 @@
        buffer_type file
        buffer_path /var/lib/fluentd/data/monasca.buffer/{{ syslog_haproxy_facility }}.*
        max_retry_wait 1800s
+       disable_retry_limit true
     </store>
 {% endif %}
 </match>
diff --git a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2
index 88039b436..f4ed33e0c 100644
--- a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2
+++ b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2
@@ -13,5 +13,6 @@
        buffer_type file
        buffer_path /var/lib/fluentd/data/monasca.buffer/openstack.*
        max_retry_wait 1800s
+       disable_retry_limit true
     </store>
 </match>
-- 
GitLab