Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Logstash v5 Support #35

Closed
6 of 10 tasks
theangryangel opened this issue Apr 13, 2016 · 8 comments
Closed
6 of 10 tasks

Logstash v5 Support #35

theangryangel opened this issue Apr 13, 2016 · 8 comments
Assignees

Comments

@theangryangel
Copy link
Owner

theangryangel commented Apr 13, 2016

Logstash v5 will be out Soon(TM).

Known, possibly incomplete things to alter

@theangryangel
Copy link
Owner Author

Updated to api 2 in 8d27e0f

@theangryangel
Copy link
Owner Author

https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/exponential-threadsafe/lib/logstash/outputs/elasticsearch/common.rb appears to be the implementation that logstash prefers.

Based on that, my TODO notes:

  • Remove Stud::Buffer
  • Consider what exceptions we want to make retry-able and what not to (question: just how feasible is this across all drivers?)
  • Do we really want it to infinitely retry? Or do we want to keep the max_exceptions ring buffer

@theangryangel
Copy link
Owner Author

e32b6e9 removes Stud::Buffer, keeps max_exceptions counter for a set of events, adds better support for recovering from batched insert failures. Missing tests.

@theangryangel
Copy link
Owner Author

theangryangel commented May 16, 2016

Notes for myself.

Currently discovering the pain from the JDBC batch behaviour. Includes, but not limited to:

  • autocommit=true+batch behaviour is undefined and driver specific
  • a driver may chose to continue processing after a failure
  • getting the error for a particular entry in the batch in the event of the above doesn't seem possible

Since the plugin may be used with any JDBC-compatible engine, it may be just safer for each event to be processed as a single command (like unsafe goes through), and batches go in the bin 😞

@theangryangel
Copy link
Owner Author

theangryangel commented May 17, 2016

Batched SQL now in the bin.

TODO: Tests for new test cases.

@theangryangel
Copy link
Owner Author

theangryangel commented May 18, 2016

Shower thought: Do we actually want to retry any non-connection related JDBC exceptions. Most seem to be fatal errors that without human intervention won't resolve by retrying.

Retryable states by class:

  • 08 — Connection Exception
  • 24 — Invalid Cursor State (MAYBE)
  • 25 — Invalid Transaction State (MAYBE)
  • 40 — Transaction Rollback (MAYBE - specifically looking at deadlocks)
  • 53 — Insufficient Resources
  • 54 — Program Limit Exceeded (MAYBE)
  • 55 — Object Not In Prerequisite State
  • 57 — Operator Intervention
  • 58 — System Error

Counter thought: JDBC drivers are inconsistent, and have their own SQLSTATE codes. Also May throw an SQL exception when they dont mean to (do we even care about this?). What's worse? Holding up the pipeline, or just losing a few events.

@theangryangel
Copy link
Owner Author

Added custom retry_sql_states configuration. Currently this is the full sql state code, not the class.

@theangryangel
Copy link
Owner Author

Closing for individual issues going forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant