Logstash jdbc input filter broken

Hi,

I am using the tracking_column functionality of logstash jdbc input plugin to fetch database values from the db. Right now, the functionality to write the last :sql_last_value" into the metadata path seems to broken. I monitored the metadata file and it seems every new update increments the value in last_run_metadata_file by exactly 1.

value at 12:45 -> 10038238 
value at 12:50 -> 10038239
value at 12:50 -> 10038240

I have provided the config below.I am on the latest stable release of logstash (4.6.0) but this functionality seems to be broken in the previous version as well.

jdbc_driver_library => "/home/user/utils/lib/jtds-1.3.1.jar"
jdbc_driver_class => "Java::net.sourceforge.jtds.jdbc.Driver"
jdbc_connection_string => "jdbc:jtds:sqlserver://hostanme.com:10503/log"
jdbc_user => "user"
jdbc_password => "password"
schedule => "*/5 * * * *"
use_column_value => true
tracking_column => id
last_run_metadata_path => "/home/user/logstash_restart_analysis_last_run_prod"
statement => "select  * from alerts al
where al.id > :sql_last_value"