double-free / mit6.824-2017-chinese Goto Github PK
View Code? Open in Web Editor NEWA Chinese version of MIT 6.824 (Distributed System)
A Chinese version of MIT 6.824 (Distributed System)
修改了 applyLog, 不知为何之前的 ApplyMsg 的参数不能fit autograder...
func (rf *Raft) applyLog() { rf.mu.Lock() defer rf.mu.Unlock() if rf.commitIndex > rf.lastApplied { for i := rf.lastApplied + 1; i <= rf.commitIndex; i++ { var msg ApplyMsg msg.CommandIndex = i msg.Command = rf.log[i].Command msg.CommandValid = true rf.applyCh <- msg } } }
In term 34: Server 0 transfer from CANDIDATE to FOLLOWER
Server 1 send vote req failed.
Server 1 send vote req failed.
panic: runtime error: index out of range [24] with length 19
goroutine 49470632 [running]:
raft/raft.(*Raft).broadcastAppendEntries.func1(0x0)
/Users/chihuiyang/Developer/UIUC/raft-mp2/src/raft/raft.go:468 +0x454
raft/raft.(*Raft).broadcastAppendEntries.func2(0x140001640c0?)
/Users/chihuiyang/Developer/UIUC/raft-mp2/src/raft/raft.go:511 +0x38
created by raft/raft.(*Raft).broadcastAppendEntries
/Users/chihuiyang/Developer/UIUC/raft-mp2/src/raft/raft.go:509 +0x128
exit status 2
FAIL raft/raft 48.910s
哈喽,你好。我最近也在学习MIT 6.824课程,看了您的github仓库,觉得很不错。冒昧问下,是否能加您为好友呢,自学不易,多多交流。
我的QQ:956318206
Wechat:zhike186137
`
if args.LeaderCommit > rf.commitIndex {
if args.LeaderCommit < rf.getLastLogIndex() {
rf.commitIndex = rf.getLastLogIndex()
} else {
rf.commitIndex = args.LeaderCommit
}
}
`
你好,请教一下,这段代码和论文里描述不一样啊,论文里接收者实现说的是“如果 leaderCommit > commitIndex,令 commitIndex 等于 leaderCommit 和 新日志条目索引值中较小的一个”,这里是不是取反了?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.