Skip to content

Commit e978b65

Browse files
committed
fix
1 parent 6fc0662 commit e978b65

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dgraph/cmd/zero/oracle.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,12 @@ func (o *Oracle) sendDeltasToSubscribers() {
263263
}
264264

265265
func (o *Oracle) updateCommitStatusHelper(index uint64, src *api.TxnContext) bool {
266-
if _, ok := o.commits.Load(src.StartTs); ok {
267-
return true
268-
}
266+
ts := src.CommitTs
269267
if src.Aborted {
270-
o.commits.Store(src.StartTs, 0)
271-
} else {
272-
o.commits.Store(src.StartTs, src.CommitTs)
268+
ts = 0
273269
}
274-
return true
270+
_, exist := o.commits.LoadOrStore(src.StartTs, ts)
271+
return !exist
275272
}
276273

277274
func (o *Oracle) updateCommitStatus(index uint64, src *api.TxnContext) {

0 commit comments

Comments
 (0)