Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
djq2
ECE 428 - Distributed Systems
Commits
6f9ce15e
Commit
6f9ce15e
authored
Apr 03, 2022
by
kevinmv2
Browse files
changing hella
parent
eac8604e
Changes
1
Hide whitespace changes
Inline
Side-by-side
mp2/src/raft/raft.go
View file @
6f9ce15e
...
...
@@ -549,6 +549,9 @@ func (rf *Raft) Commit(command interface{}) {
LeaderCommit
:
rf
.
commitIndex
}
}
rf
.
log
=
append
(
rf
.
log
,
newEntry
)
rf
.
lastApplied
=
len
(
rf
.
log
)
-
1
messageIDX
=
rf
.
lastApplied
var
commitlock
sync
.
Mutex
commit_cond
:=
sync
.
NewCond
(
&
commitlock
)
...
...
@@ -601,7 +604,7 @@ func (rf *Raft) Commit(command interface{}) {
return
}
if
count
>
majority
{
rf
.
log
=
append
(
rf
.
log
,
newEntry
)
rf
.
commitIndex
=
messageIDX
commitlock
.
Unlock
()
return
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment