etcd-io / website

etcd.io
https://etcd.io
Other
147 stars 295 forks source link

etcd3 API: transactions #652

Open cenkalti opened 1 year ago

cenkalti commented 1 year ago

Can this page be updated to include answer to the question below?

https://etcd.io/docs/v3.5/learning/api/#transaction

Inside a transaction, there is a compare, success and failure blocks. When a follower receives a transaction, does it evaluate the compare block locally then send success/failure operation to the leader, or is the whole transaction definition is forwarded to the leader and compare block is evaluated on the leader?

chaochn47 commented 1 year ago

Hi cenk, from my understanding, the transaction API handling is on MVCC layer which has nothing to do with raft state (leader or follower). Once one of the etcd servers receives the Txn request, the server will process it after building the consensus and send it back to client.

Hope it helps :)