guaranteeing that only node would issue (in the case that a leader election takes place during a transaction).
--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello all,
... I am considering adding full transaction support to rqlite -- basically I would allow users to send explicit BEGIN and COMMIT (or ROLLBACK) commands to the leader ...
This is certainly one of the proposals to dealing with coordinator failures in two phase commit. There is a lot of literature on handling coordinator/participant failures in 2PC.l that would be useful to you.We implemented transactions for cross-shard operations in ONOS/Atomix using two-phase commit. To handle coordinator (or client) failures, we use failure detectors and an atomic check-and-set operation to determine which node will take over as coordinator and complete the transaction after a failure is detected. To do this, some transaction state also has to be stored in Raft:• When a transaction is started, store a transaction ID, coordinator ID, and transaction state, e.g. PREPARING
• When a transaction is committed or rolled back, update the state to COMMITTING/ROLLING_BACK prior to actually performing the operation
• After a failure, a new coordinator takes over by updating the coordinator ID using an atomic check-and-set (through Raft) and the new coordinator uses the transaction state to complete or rollback the transaction
Granted, this is a much different use case because the architecture is so much different. We use two-phase commit in a sharded Raft cluster and multiplex many state machines on a single Raft log within each partition, and these are basically clients taking over transactions for other clients. But the solution is still the same. A timeout is nothing but a rudimentary failure detector. So yes, I think it’s a fine solution, you just have to handle the case where a healthy client’s transaction is rolled back.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
Is there a reason you can't treat the transaction as a single block?So instead of doing this as a separate commands, treat it as a batch?
Alternatively, have the leader send a timer message via Raft and have explicit timeout mechanism via this manner?So you send BEGIN TX, then have it timeout if there are 15 timer messages or something like that?