Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
fix unprotected updated of last-seqnum, etc (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran RG authored and Guillaume Bailey committed Apr 21, 2017
1 parent ce6497f commit 1a3a1f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/storehost/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ pump:

msg := readMsg.GetMessage()
msgSeqNum := msg.GetMessage().GetSequenceNumber()
visibilityTime := x.messageVisibilityTime(msg.GetMessage())

if replicateDebug {
log.WithFields(bark.Fields{ // #perfdisable
Expand Down Expand Up @@ -492,8 +493,10 @@ pump:

credLine.Return(1) // TODO: make credits proportional to payload size

// update lastSeqNum with this seqnum
x.setLastSeqNum(msgSeqNum)
// update last-seqnum, etc (reported by extStats)
x.extentLock()
x.setLastMsg(int64(key), msgSeqNum, visibilityTime)
x.extentUnlock()
}

close(t.credC) // this should close the sendPump
Expand Down

0 comments on commit 1a3a1f4

Please sign in to comment.