Skip to content
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

Use http output with json batch #102

Closed
wants to merge 4 commits into from

Conversation

njuguna-n
Copy link
Contributor

@njuguna-n njuguna-n commented May 16, 2024

Closes #101

@njuguna-n njuguna-n requested review from witash and lorerod May 16, 2024 09:17
@njuguna-n njuguna-n marked this pull request as ready for review May 16, 2024 09:18
@njuguna-n
Copy link
Contributor Author

There should be an additional PR to update the helm charts if this PR is merged first.

@witash
Copy link
Contributor

witash commented May 17, 2024

with this configuration if the postgrest responds with a 40X response code and doesn't write data. the couchdb plugin will advance the sequence anyway, leading to data loss.

I tested by running locally with docker compose, then dropping the root table. All response from postgrest were then 404 since the table doesn't exist. then run docker exec cht_sync_local-logstash-1 cat /tmp/couchdb/sequence_path.txt several times and it was still increasing.

this also seems to be the case without format => json_batch

I tried every combination of retry_failed, ignorable_codes and automatic_retries but wasn't able to get logstash to stop updating the sequence as long as it got any response from postgrest (success or failure)

It seems the http output plugin differentiates between "library failures" (can't get a connection at all) and "plugin failures" (HTTP status 404) and only stops the pipeline for "library failures"
https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html#plugins-outputs-http-retry_policy

So unless there is a configuration I'm missing, Im not sure the http plugin can work, batch or no batch...

@njuguna-n
Copy link
Contributor Author

Given the comment above and some other offline discussions about the use of logstash for the sync process I will close this PR.

@njuguna-n njuguna-n closed this May 22, 2024
@njuguna-n njuguna-n deleted the 101-try-using-http-output-with-json_batch branch May 22, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use json_batch in Logstash HTTP output
3 participants