zk1931 / jzab

ZooKeeper Atomic Broadcast in Java
http://zk1931.github.io/jzab/master/
Apache License 2.0
54 stars 23 forks source link

hide zxid from applications? #209

Closed ghost closed 9 years ago

ghost commented 9 years ago

how would an application use zxid from preprocess/deliver?

http://zk1931.github.io/jzab/0.4.0-SNAPSHOT/javadoc/

ghost commented 9 years ago

@EasonLiao let me know what you think.

EasonLiao commented 9 years ago

sorry for my late response, I thought zxid in deliver is useless but I changed my mind in pulsed. I think it's necessary to implement pulsed without idempotency requirement. Since the snapshot is always consistent so we just need to remember the last zxid which makes the root node in snapshot and in recovery we just don't apply the transaction before the zxid then we can get rid of idempotency requirement, make sense?

ghost commented 9 years ago

why would zab deliver transactions with zxids earlier than the snapshot zxid?

EasonLiao commented 9 years ago

because the snapshot and delivery of transaction happen in different threads. The snapshot thread only knows the last zxid of transaction which is guaranteed in state machine, not the most recent one.

ghost commented 9 years ago

ok i understand.