concurrency: retry snapshot serializable stm if writes since first header rev

Was checking the rset key mod rev, which does not work.
This commit is contained in:
Anthony Romano 2017-08-22 14:48:51 -07:00
parent b9ef49142c
commit 1d195521c7

View File

@ -193,11 +193,12 @@ func (rs readSet) add(keys []string, txnresp *v3.TxnResponse) {
}
}
// first returns the store revision from the first fetch
func (rs readSet) first() int64 {
ret := int64(math.MaxInt64 - 1)
for _, resp := range rs {
if len(resp.Kvs) > 0 && resp.Kvs[0].ModRevision < ret {
ret = resp.Kvs[0].ModRevision
if rev := resp.Header.Revision; rev < ret {
ret = rev
}
}
return ret