Skip to content

Commit

Permalink
util: resolve data race (#14610)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsqlu authored Feb 4, 2020
1 parent 2192448 commit 7720d7d
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 @@ -727,9 +727,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 7720d7d

Please sign in to comment.