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

RDBMS ingestion process can miss updates #128

Open
banderous opened this issue May 5, 2023 · 0 comments
Open

RDBMS ingestion process can miss updates #128

banderous opened this issue May 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@banderous
Copy link

banderous commented May 5, 2023

This bug concerns the RDBMS ingestion process as described in the official docs

The suggested approach is based on tracking row modification time in the sql_last_value of the jdbc plugin and using it to find any rows modified since the previous logstash query.

For this to be correct would require every changed row's modification_time to be >= the current max modification_time but this is not the case - a row's modification_time is the time the row was written and not the time the database transaction committed - which could be significantly later.

It is therefore possible for a row to be committed with a modification time lower than the current maximum modification time and never get indexed since it's modification_time will be < sql_last_value.

Steps to reproduce:

I was able to reproduce this by following the linked tutorial and using two different database connections (C1 & C2):

C1 - begin; INSERT INTO es_table (id, client_name) VALUES (4,"Missing!"); -- Never gets indexed

C2 - INSERT INTO es_table (id, client_name) VALUES (5,"latest"); -- Gets a higher modification_time, indexed
  -- wait for logstash query to run
C1 - commit;

The row inserted on C1 never gets indexed since when committed it has a lower modification_time than the row committed on C2.

@banderous banderous added the bug Something isn't working label May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant