Hey all, For some reason when using the KafkaSink...
# troubleshooting
o
Hey all, For some reason when using the KafkaSink with DELIVERY_ONCE and restarting the application without a checkpoint (it had a
last-state
configuration, but we needed it in a fresh state, so we upgraded it with the
stateless
configuration), it takes a really long time to initialize the KafkaSink operator, could take more than an hour. From looking at the logs, it seems that it tries to send InitProductId for each previous checkpoint id it had incrementally from 0. Anyone knows why this is happening when trying to start with a clean state? How can we solve this?
m
Did you set a new
setTransactionalIdPrefix
?
o
No, it's the same TransactionalIdPrefix as before. Plus when changing it, it's quickly initialized.
m
The situation that you're now in, is that you have lingering transactions that aren't correctly aborted. That's also what you see from the logs
o
What is the best approach here?
m
If you really want to start fresh, then you should basically start as a completely new job.
Is your source Kafka too?
o
Yes
I'm trying to understand why it's taking so long, the once's that wasn't aborted are probably the ones from the last checkpoint that was not completed, no? It should be less than the parallelism count
m
It's not only the last checkpoint, but can be for multiple
o
I configured only one checkpoint in parallel, so the rest of them completed successfully
m
Most likely you should be good, in theory there might be a lingering transaction but that's most likely not the case for you
But transaction aborting is always expensive and takes a long time
o
If I will start a completely new job, will it fix that?
m
It should yes, you're basically a new consumer and producer in that case
As long as you make sure that all references to things like consumer groups, transaction ID prefixes etc are all different
o
Hmm that's a problem actually
In the end that's what we did, change the prefix whenever we start the application without a checkpoint 🙂
Maybe it will be good to suggest this as a feature that's configurable, whether we want to change the prefix on starting the application in stateless mode, that way it won't need to abort lingering transactions and will save a lot of time
m
That’s a conflicting result: you want exactly once but then you want to restart in stateless mode. Those things are conflicting with each other
o
I don't agree, since you can start with a clean state but continue from the last committed message in Kafka, you will read and process only once each message even if you switch prefix.