Skip to content

Commit

Permalink
util: resolve data race (#14778)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Feb 13, 2020
1 parent 58c2915 commit 3c135e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/stmtsummary/statement_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,10 @@ func (ssElement *stmtSummaryByDigestElement) add(sei *StmtExecInfo, intervalSeco
if commitDetails.GetCommitTsTime > ssElement.maxGetCommitTsTime {
ssElement.maxGetCommitTsTime = commitDetails.GetCommitTsTime
}
ssElement.sumCommitBackoffTime += commitDetails.CommitBackoffTime
if commitDetails.CommitBackoffTime > ssElement.maxCommitBackoffTime {
ssElement.maxCommitBackoffTime = commitDetails.CommitBackoffTime
commitBackoffTime := atomic.LoadInt64(&commitDetails.CommitBackoffTime)
ssElement.sumCommitBackoffTime += commitBackoffTime
if commitBackoffTime > ssElement.maxCommitBackoffTime {
ssElement.maxCommitBackoffTime = commitBackoffTime
}
resolveLockTime := atomic.LoadInt64(&commitDetails.ResolveLockTime)
ssElement.sumResolveLockTime += resolveLockTime
Expand Down

0 comments on commit 3c135e5

Please sign in to comment.