Explorar o código

grpcproxy: invalidate cache on comparison range

Anthony Romano %!s(int64=9) %!d(string=hai) anos
pai
achega
aeb2dc03aa
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      proxy/grpcproxy/kv.go

+ 1 - 1
proxy/grpcproxy/kv.go

@@ -123,7 +123,7 @@ func (p *kvProxy) Txn(ctx context.Context, r *pb.TxnRequest) (*pb.TxnResponse, e
 	}
 	}
 	// txn may claim an outdated key is updated; be safe and invalidate
 	// txn may claim an outdated key is updated; be safe and invalidate
 	for _, cmp := range r.Compare {
 	for _, cmp := range r.Compare {
-		p.cache.Invalidate(cmp.Key, nil)
+		p.cache.Invalidate(cmp.Key, cmp.RangeEnd)
 	}
 	}
 	// update any fetched keys
 	// update any fetched keys
 	if resp.Succeeded {
 	if resp.Succeeded {