Is Orleans Transactions ready for production?
So far after using it full scale for 4 weeks, it feels like Orleans transactions still have ways to go and it's not ready for production. We have been getting constant issues as described in #5644, and even after designing our implementation away from "multiple calls to the same grain within the same transaction", we are still getting issues with broken lock exceptions. In fact while running tests, the failure seems to cascade to other transactions as well, causing all the tests to fail. It will be good to perhaps document the limitations of transactions as well as techniques to prevent broken lock exceptions or deadlocks
Hi @jinhong-
production ready is hard to define, but we do have internal team uses transaction, with production load, and is happy with it. Transaction is carefully load tested in orleans team and we partnered with an internal team to test it with real production load. So I think we have fair confident that it is production ready. With that being said, transaction does have limitations and a lot room to grow. So feedback is always welcome.
For example in #5644 , it seems that the problem there is the transactional state is not compatible with non-reentrant grains, which is a limitation which should be documented in transaction doc. But this doesn't necessarily mean transaction isn't production ready, it just means transaction at this state doesn't work with non-reentrant grains. As to cascade failures, it is designed to happen in certain scenarios, it happens when transaction failure causing its dependent transactions to fail. It is happening in your test may indicate bugs, or you are just hitting those scenarios.
And yes I agree, transaction needs better docs. And I apologize for the inconvenience. But for your case, how about you explain how you use transactions, your application architecture , so we can help better?
Hi @xiazen, I will try to explain it as much as possible. We are first and foremost building some sort of transactional system, which is why we want to utilize transactions. The system fundamentally is similar to bank accounts. You create a transaction, and the transaction could potentially affect 2 or more accounts. Accounts are what we use to track balances
In order to meet with the scale of system requirements, we are also doing account "sharding", pardon the terminology, what we do is that we split 1 account into multiple grain instances, this way it helps to increase transaction throughput. We then have a timer that synchronizes the balance back into the primary shard. Kind of like the total and subtotal grain pattern. This is also done in a transaction
We also need to query the transactions and balances and return a list of transactions/balances, and orleans is not well suited for doing this. So we used some sort of event publishing mechanism to have read models for this. The events are first enqueued into a grain, participating in the same transaction. When the transaction finishes, we then publish the messages and clear away the events
@jinhong did you had success using Transaction at your project?
Please let us know to understand if we can move forward and close this issue.
Thanks in advance!
@Caldas unfortunately no. At the time of using, we did not feel that it was ready. For some reason even after following the documentations, we constantly had issues with transactional grains freezing. Also we were on AWS infrastructure and at the point in time when we used transactional grains, there was only "official" support for azure table. Everything else was primarily for development purposes. Since, we have dropped the usage of orleans transactional grains.I will close this issue and re-open it again when needed. Thank you