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

Kafka Transactional writer #174

Open
big-andy-coates opened this issue Sep 16, 2024 · 5 comments
Open

Kafka Transactional writer #174

big-andy-coates opened this issue Sep 16, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@big-andy-coates
Copy link

big-andy-coates commented Sep 16, 2024

Is your feature request related to a problem? Please describe.
If change events read from the database are being output to Kafka, with state written to a file on disk, there is the possibility to get duplicate events in Kafka, e.g. if OLR writes to Kafka, then crashes before writing to the file on disk, when it restarts it will resend change events to Kafka, causing duplicates in Kafka.

Describe the solution you'd like
Exactly once delivery semantics are possible using Kafka's transactional support. One solution would be to enhance OLR to support storing state in a Kafka topic, with writes to store change events and state contained in the same Kafka transaction. Then Kafka either contains both the change events and the updated state, or neither.

Describe alternatives you've considered
If storing change events and state in two different technologies, e.g. Kafka and file on disk, it's not possible to support exactly once delivery semantics. So the only solution I can think of is to enhance OLR to support storing state in Kafka (either in its own state topic, or potentially in the headers of the change events it writes to Kafka), and leverage Kafka's transaction support to ensure no duplicates are published in the presence of partial failures.

Additional context
Currently running a spike to investigate OLR. At this point, I'm looking to touch base and see if such a feature seems possible for OLR...? It's been a long time since I've worked in C++, but there may be scope for me to help with the feature. TBC.

@bersler bersler added the enhancement New feature or request label Sep 19, 2024
@bersler
Copy link
Owner

bersler commented Sep 19, 2024

Hi @big-andy-coates, thanks for creating a separate ticket for this task.
This is a known topic. The current implementation does not use transactional Kafka API.
This might be a good task to do if there is a business demand for this feature. If there is a business case then this feature might be implemented.

@bersler bersler changed the title Kafka EOS Kafka Transactional writer Sep 19, 2024
@big-andy-coates
Copy link
Author

Good to hear @bersler.

Let's see which way the winds blow with my employer and if this gets resources assigned.

@bersler
Copy link
Owner

bersler commented Nov 6, 2024

Hi @big-andy-coates , do you actually have a business case with a customer who would benefit from this improvement?

@big-andy-coates
Copy link
Author

big-andy-coates commented Nov 7, 2024

I'm working with a client that is currently investigating if OLR meets their needs.

Initially, eos is not a requirement, but eos is a requirement in the medium term.

@bersler
Copy link
Owner

bersler commented Nov 28, 2024

I plan to make some code refactor of the Kafka writer anyway. So maybe it would get implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants