Transaction - Received update failure exception from mongo, but could see update in Database

Hello All,

I have a scenario where i make 2 updates in a @Transactional block of Spring Data.
We for sure know that the mongo DB clusters were being restarted during the updates.

Now during the execution, the Spring app received the error
“Could not commit mongo Transaction to session”, but when we see the database after the restart, the updates made were visible.

Could someone help in understanding why this might happen?

Good morning!

What type of Write Concern were you using?

We have 3 nodes in a cluster and write concern is Majority.
and we for sure know that it was rolling restarts of the nodes