MCPcopy
hub / github.com/dgraph-io/dgraph / hasConflict

Method hasConflict

dgraph/cmd/zero/oracle.go:72–88  ·  view source on GitHub ↗

TODO: This should be done during proposal application for Txn status.

(src *api.TxnContext)

Source from the content-addressed store, hash-verified

70
71// TODO: This should be done during proposal application for Txn status.
72func (o *Oracle) hasConflict(src *api.TxnContext) bool {
73 // This transaction was started before I became leader.
74 if src.StartTs < o.startTxnTs {
75 return true
76 }
77 for _, k := range src.Keys {
78 ki, err := strconv.ParseUint(k, 36, 64)
79 if err != nil {
80 glog.Errorf("Got error while parsing conflict key %q: %v\n", k, err)
81 continue
82 }
83 if last := o.keyCommit.Get(ki); last > src.StartTs {
84 return true
85 }
86 }
87 return false
88}
89
90func (o *Oracle) purgeBelow(minTs uint64) {
91 var timer x.Timer

Callers 2

commitMethod · 0.95
commitMethod · 0.80

Calls 2

GetMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected