Skip to content

Commit 25de105

Browse files
committed
make batchupdate idempotent
1 parent 2f1ff34 commit 25de105

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

store/etcdv3/meta/etcd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (e *ETCD) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantRespon
308308
func (e *ETCD) batchUpdate(ctx context.Context, data map[string]string, opts ...clientv3.OpOption) (*clientv3.TxnResponse, error) {
309309
limit := map[string]map[string]string{}
310310
for key := range data {
311-
limit[key] = map[string]string{cmpVersion: "!=", cmpValue: "!="} // ignore same data
311+
limit[key] = map[string]string{cmpVersion: "!="}
312312
}
313313
resp, err := e.batchPut(ctx, data, limit, opts...)
314314
if err != nil {

0 commit comments

Comments
 (0)