Take snapshot in broadcasting phase and use snapshot for recovery.

For this commit, we don't trim the log. After the snapshot is taken, next time instead of recovering from log, it will recover from snapshot + log.