Bug 1565214

Summary: omelasticsearch needs better handling for bulk index rejections and other errors
Product: Red Hat Enterprise Linux 7 Reporter: Rich Megginson <rmeggins>
Component: rsyslogAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.6CC: anli, dapospis, dkopecek, jvymazal, mifiedle, mthacker, nhosoi, nkinder, pportant, rmeggins, schituku
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rsyslog-8.24.0-24.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:17:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rich Megginson 2018-04-09 16:08:06 UTC
Description of problem:
The current upstream fluent-plugin-elasticsearch handles bulk index rejections by retrying them, and also retrying other errors.  We might be able to do better in rsyslog:

- identify errors that can be retried, such as bulk index rejections, sleep, then resubmit those records to the rsyslog queue
- identify errors that cannot be retried (e.g. schema violations) and write those records to some sort of "dead letter queue" - a local file (could also be the omelasticsearch errorfile)

We need some way to associate the errors with the records, so we will need also to implement support for a unique record identifier.

- rsyslog assigns a unique id to each record
- omelasticsearch plugin uses this as the _id field
- omelasticsearch plugin assembles a bulk index request from many records and submits
- omelasticsearch processes the response from elasticsearch
- if the error is transient, find the original record with the id in the error response and resubmit it
- if the error is permanent, find the original record with the id in the error repsonse and write it to the error file

the trick is mapping the id in the error response back to the original record.  We might need some sort of hash table in omelasticsearch - the key is the _id, and the value is the original message.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

This is a must-have feature for common logging and openshift logging.

Comment 13 Rich Megginson 2018-07-24 22:05:50 UTC
@schituku - https://github.com/openshift/origin-aggregated-logging/pull/1259
This configures rsyslog to retry failed elasticsearch operations, and write any "hard" errors to 
/var/lib/rsyslog/es-bulk-errors.log

Comment 15 Anping Li 2018-08-27 05:22:35 UTC
Verified and pass with rsyslog-elasticsearch-8.24.0-33.el7.x86_64, atomic-openshift-3.11.0-0.19.0.  The rejected logs are sent to Elasiticsearch again.

Comment 18 errata-xmlrpc 2018-10-30 10:17:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3135