Tencent / phxpaxos

The Paxos library implemented in C++ that has been used in the WeChat production environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phxpaxos 如何保证latest read

ziyinweixiao opened this issue · comments

现在有A, B, C三个节点, A节点是Master, 读写操作从A进行,如果A节点同一时间进来两个 propose 操作pro1 和pro2 , pro1先 进行提案, 在提案成功后, A节点状态机执行时间比较长,超过了Master续约时间, 此时B节点进行trybemaster 并成为Master, 然后A节点的pro2号请求继续执行, 在2号提案通过并且状态机执行完成之后,会不会导致, 从B节点进行的读操作 没有做到latest read

commented

check: BeforePropose

  1. Check master state in BeforePropose func.
  2. If not master in this moment, do some modification on propose's value. For example, add some flag.
  3. Recognize this flag on Execute function and do something.