-
Notifications
You must be signed in to change notification settings - Fork 187
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
clean_run: true does not work for sql statement #373
Comments
The |
Just stumbled upon this issue myself on version I've been having a look at the code myself, but since Any suggestions? |
Just conducted some tests, and even with I'm guessing this happens since, internally, the plugin is still storing the last value of the So far I haven't found any working combination of parameters that, with the current state of things, allows to do what the The only solution that has worked for me so far is not to use |
@adeharo9 I've never found any working combinations of parameters to go around this issue. What I did is just a patch in the code of the plugin. We use a modified version of it and I added this code: @value_tracker.set_value(sql_last_value) if @record_last_run This way if |
logstash-plugins/logstash-integration-jdbc#121 (comment) I had to look in the code to extract this. But as it instantiate that class (ValueTracking) once, it will persist the sql_last_value in the class unless logstash is restarted before each pipeline... UPDATE logstash-plugins/logstash-integration-jdbc#121 (comment) |
Using jdbc plugin 4.3.13
Using logstash in docker: docker.elastic.co/logstash/logstash:7.1.1
In theory clean_run setting of the jdbc plugin decides:
Again, in theory if we set clean_run: true, the sql_last_value should become '1970-01-01 00:00:00'
However, in practice, the clean_run: true in the example below still causes the pipeline to keep the last run state under the :sql_last_value parameter (the date of last run in our case).
:sql_last_value is set to '1970-01-01 00:00:00' only when the pipeline starts for the first time.
2nd and next runs don't start from '1970-01-01 00:00:00', the sql query still contains value of the last run.
Logs:
1st run is OK:
2nd run NOT ok:
3rd run and any later on NOT ok:
You can reproduce the behaviour with this input:
In order to start the pipeline from "0" ('1970-01-01 00:00:00'), we need to redeploy the logstash.
Could anyone explain this to me? Either I miss some understanding or the plugin doesn't work as expected - a bug.
From my understanding the "clean_run: true" should cause the :sql_last_value param to be "zero" each time the pipeline starts, in the example above it keeps the state...
The text was updated successfully, but these errors were encountered: