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

Consider to move post-register actions to register phase #1185

Open
kaisecheng opened this issue Jul 6, 2024 · 1 comment
Open

Consider to move post-register actions to register phase #1185

kaisecheng opened this issue Jul 6, 2024 · 1 comment

Comments

@kaisecheng
Copy link
Contributor

kaisecheng commented Jul 6, 2024

Currently, this plugin splits the initial setup to two parts, register and post-register (finish_register)

register mainly do two things

  • basic config checking that does not require to communicate to Elasticsearch
  • initialise connection pool which requires to pass health check getting 200 from Elasticsearch

post-register mainly do server check

  • check license
  • check support version
  • install index template
  • setup ilm

Issue

The problem with performing post-register actions after the register phase is that the pipeline perceives itself as having started successfully and begins ingesting data into the queue. Meanwhile, the post-register actions may signal to shut down the pipeline before the plugin taking any event if the setup or checking fails.

When the pipeline uses a memory queue, shutting it down requires draining the queue first. However, the events cannot be consumed in this case because the plugin fails during the post-register phase.

The shutdown process is stuck, and it is not possible to trigger a reload of the pipeline

Perform all checking in register phase
The good part is that we have a complete pipeline, rather than showing 'pipeline started' with only partial success. Once the pipeline starts, it is ready to send events out, no events stuck in the middle

Why was it designed to be two parts?
In the past, one concern was to make the plugin fail fast, perform minimal checking, and then allow ingestion to start.
With a persistent queue, processing events before completing the output setup works fine.

Consideration

Post-register does not do retries at the moment, but we should probably implement that. We need to consider the time taken for retries during the register phase, how long we are willing to wait, and how this will pause the ingestion process

@kaisecheng
Copy link
Contributor Author

Todo: investigate reason why ILM setup was done post register before moving it to register.

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

No branches or pull requests

1 participant