Skip to content

Commit

Permalink
clientv3: disable retry for mutable KV RPCs
Browse files Browse the repository at this point in the history
Was retrying when it shouldn't, causing multiple puts
  • Loading branch information
Anthony Romano committed Jul 31, 2017
1 parent a4638aa commit c4e830e
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions clientv3/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,35 +101,19 @@ type retryWriteKVClient struct {
}

func (rkv *retryWriteKVClient) Put(ctx context.Context, in *pb.PutRequest, opts ...grpc.CallOption) (resp *pb.PutResponse, err error) {
err = rkv.retryf(ctx, func(rctx context.Context) error {
resp, err = rkv.KVClient.Put(rctx, in, opts...)
return err
})
return resp, err
return rkv.KVClient.Put(ctx, in, opts...)
}

func (rkv *retryWriteKVClient) DeleteRange(ctx context.Context, in *pb.DeleteRangeRequest, opts ...grpc.CallOption) (resp *pb.DeleteRangeResponse, err error) {
err = rkv.retryf(ctx, func(rctx context.Context) error {
resp, err = rkv.KVClient.DeleteRange(rctx, in, opts...)
return err
})
return resp, err
return rkv.KVClient.DeleteRange(ctx, in, opts...)
}

func (rkv *retryWriteKVClient) Txn(ctx context.Context, in *pb.TxnRequest, opts ...grpc.CallOption) (resp *pb.TxnResponse, err error) {
err = rkv.retryf(ctx, func(rctx context.Context) error {
resp, err = rkv.KVClient.Txn(rctx, in, opts...)
return err
})
return resp, err
return rkv.KVClient.Txn(ctx, in, opts...)
}

func (rkv *retryWriteKVClient) Compact(ctx context.Context, in *pb.CompactionRequest, opts ...grpc.CallOption) (resp *pb.CompactionResponse, err error) {
err = rkv.retryf(ctx, func(rctx context.Context) error {
resp, err = rkv.KVClient.Compact(rctx, in, opts...)
return err
})
return resp, err
return rkv.KVClient.Compact(ctx, in, opts...)
}

type retryLeaseClient struct {
Expand Down

0 comments on commit c4e830e

Please sign in to comment.