We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这篇文章里: https://vizee.org/2019/12/11/caspaxos-implement/
Acceptor 需要存储2个ballot: 除了下面这个见到的最大ballot, 还有一个最后接受一个value时的ballot:
type Acceptor struct { mu sync.Mutex ballotNum int // vballot int value *ValueType }
onAccept时, 需要更新vballot:
func onAccept(args *Propose) *Accept { acceptor := &self.acceptor acceptor.mu.Lock() defer acceptor.mu.Unlock() if acceptor.ballotNum > args.BallotNum { return &Accept{ OK: false, } } acceptor.ballotNum = args.BallotNum // Add the following line: // acceptor.vbalot = args.BallotNum acceptor.value = args.Value return &Accept{ OK: true, } }
CASPaxos paper里写的不清楚,完全没提vballot, 它的TLA里有提到: https://gist.github.com/grogers0/c7e87f9dfe58c6070b19db9d3c073b72#file-gryadkacasregister-tla-L50
ballot跟vballot跟classic paxos中的行为是一样的. 这里有一个classic paxos中实现accept的例子: https://github.com/openacid/paxoskv/blob/93cbcd20b37d5588880130d263a8dcfdec5d4544/paxoskv/impl.go#L258-L281
The text was updated successfully, but these errors were encountered:
@drmingdrmer 抱歉,我今天才看到 issue,这个 vballot 的设计我需要再理解一下,非常感谢大佬指正!
Sorry, something went wrong.
已经修复问题代码,再次感谢 xp 大佬回复❤️
No branches or pull requests
这篇文章里:
https://vizee.org/2019/12/11/caspaxos-implement/
Acceptor 需要存储2个ballot: 除了下面这个见到的最大ballot, 还有一个最后接受一个value时的ballot:
onAccept时, 需要更新vballot:
CASPaxos paper里写的不清楚,完全没提vballot, 它的TLA里有提到:
https://gist.github.com/grogers0/c7e87f9dfe58c6070b19db9d3c073b72#file-gryadkacasregister-tla-L50
ballot跟vballot跟classic paxos中的行为是一样的. 这里有一个classic paxos中实现accept的例子:
https://github.com/openacid/paxoskv/blob/93cbcd20b37d5588880130d263a8dcfdec5d4544/paxoskv/impl.go#L258-L281
The text was updated successfully, but these errors were encountered: