gklijs / mongo-transaction-concurrent

MIT License
0 stars 0 forks source link

How can i remove these errors in my logs ? #1

Open ugurberkecan opened 2 weeks ago

ugurberkecan commented 2 weeks ago

You said it’s not a problem, but how will we resolve this error? Should we implement a retry mechanism for it?

gklijs commented 1 week ago

Can you provide a bit more context please? It's been a long time since I worked on this.

ugurberkecan commented 1 week ago

I'm observing 112 write conflict errors in Datadog related to some Axon events, and I'm also seeing the following error after 112 write conflict error:

Error occurred. Starting retry mode.
org.springframework.transaction.TransactionSystemException: Could not commit Mongo transaction for session

I suspect this issue arises because two threads are working on the same data concurrently. According to the readme file of this repository, these conflicts don't result in data loss, as the final number of documents in the projection matches the number of events plus one.

How can I hide or remove these exceptions in Datadog? Should I implement custom retry logic for Mongo transactions, or is there another approach I should consider?

gklijs commented 1 week ago

I'm not sure. It needs to be an exception, otherwise it won't be retried. So hiding it in Datadog might be the best thing to do, but its been too long I did something with Datadag. It's likely hard to implement retry logic correcty, as it happens down at the commit phase. There might be better options, but please ask at discuss.axoniq.io for more reach.