Skip to content
Snippets Groups Projects
Commit 6f9ce15e authored by kevinmv2's avatar kevinmv2
Browse files

changing hella

parent eac8604e
No related branches found
No related tags found
No related merge requests found
...@@ -549,6 +549,9 @@ func (rf *Raft) Commit(command interface{}) { ...@@ -549,6 +549,9 @@ func (rf *Raft) Commit(command interface{}) {
LeaderCommit: rf.commitIndex} LeaderCommit: rf.commitIndex}
} }
rf.log = append(rf.log, newEntry)
rf.lastApplied = len(rf.log) - 1
messageIDX = rf.lastApplied
var commitlock sync.Mutex var commitlock sync.Mutex
commit_cond := sync.NewCond(&commitlock) commit_cond := sync.NewCond(&commitlock)
...@@ -601,7 +604,7 @@ func (rf *Raft) Commit(command interface{}) { ...@@ -601,7 +604,7 @@ func (rf *Raft) Commit(command interface{}) {
return return
} }
if count > majority { if count > majority {
rf.log = append(rf.log, newEntry) rf.commitIndex = messageIDX
commitlock.Unlock() commitlock.Unlock()
return return
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment