A personal implementation of MIT 6.824.
WSL2 + Ubuntu20.04 + Go1.19.4
- Mind the shared data structure,they had better to be currency protected.
- Use sync.cond to control the execute phase.
- Use chan to produce and consume tasks.
- Use goroutine to follow each task's state as soon as it is consumed.(By Sleeping 10s and then wake up to check.)
- command "wait - n" seems does not exist on centos 7,use the following command to replace it in "early exists test".
while [ ! -e $DF ]
do
sleep 0.2
done
- It's proved that the clear log can truely make debugging process much easier.I built a debug util under the guidance.
- Be sure that election timeout is random enough.(Don't use time.Now() as a random seed,it's proved to be an awful choice when several nodes reset the election timeout at the same time).
- It's proved that testing with script automatically is a great choice.I built Serial Script and Parallel Script.