diff --git a/pkg/snapshot/restorer/restorer.go b/pkg/snapshot/restorer/restorer.go index 2b6c730ce..17049cfc1 100644 --- a/pkg/snapshot/restorer/restorer.go +++ b/pkg/snapshot/restorer/restorer.go @@ -662,7 +662,13 @@ func applyEventsToEtcd(client *clientv3.Client, events []event) error { return fmt.Errorf("Unexpected event type") } } - _, err := client.Txn(ctx).Then(ops...).Commit() + fmt.Print("The size of operations is: ", len(ops)) + var err error + for len(ops)/100 > 0 { + _, err = client.Txn(ctx).Then(ops...).Commit() + ops = ops[100:] + } + _, err = client.Txn(ctx).Then(ops...).Commit() return err }