-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fluent-Bit does not handle 201-Created with 409-Conflicts errors from ElasticSearch correctly #6341
Comments
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
This is a one-liner fix that reduces unnecessary requests to Elasticsearch server when it is overloaded. The issue needs to remain open. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
This issue was closed because it has been stalled for 5 days with no activity. |
@simbou2000 We currently have exactly this problem. But I wonder why you didn't create it as a pull request in the first place? |
Hi, I tried to write another candidates to fix this issue: #9236 |
Bug Report
Describe the bug
ElasticSearch server returns responses that Fluent-Bit will parse and check if there were any issues with the data it just transmitted.
Right now, Fluent-Bit does handle a case of "error" where ElasticSearch informs of "conflicts" and Fluent-Bit will silently ignore that as a successful transmission. (https://github.com/fluent/fluent-bit/blob/master/plugins/out_es/es.c#L773-L776)
This check however will fail if the last bulk had both conflicts and created entries since the status code for a created entry is 201, which Fluent-Bit will consider it as an error.
I have included an example of chunk being transmitted 5 times and their ElasticSearch responses in the screenshot section.
1st attempt: errors=true, an overload reject, but created 2 entries from the bulk.
2nd attempt: errors=true, an overload reject again, with 2 conflicts from the 1st attempt.
3rd attempt: Same as 2nd attempt.
4th attempt: errors=true, created the last entry, with the same 2 conflicts as before.
5th attempt: errors=true, 3 conflicts, but Fluent-Bit handle this as a success.
The 4th attempt in this case should have been a success since even if ElasticSearch indicates there was an error (errors=true), Fluent-Bit handles conflicts as a non-issue, but a 201 (created) status code was also mixed within those items and treated it as an actual error.
This cause Fluent-Bit to resend the same bulk multiple times more than necessary and put a higher stress on the ElasticSearch server.
Seen other cases where the following attempt were 429 Rejected although it already sent that bulk correctly.
To Reproduce
Use ElasticSearch output with any kind of data where the server is under heavy load or a simulated overloaded server.
Expected behavior
Fluent-Bit should also exclude code 201 in this check: https://github.com/fluent/fluent-bit/blob/master/plugins/out_es/es.c#L773-L776
For example:
Possibly other codes or any 2xx status codes should be excluded too.
Screenshots
Your Environment
Additional context
Wrongly detecting a problem when a mix of conflicts and created entries in ElasticSearch bulk only cause more stress on ElasticSearch server by resending the whole bulk again.
The text was updated successfully, but these errors were encountered: