From b4b5a9d7dedeac8ffa26eb8969f2780a41eec843 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Fri, 10 Jul 2020 15:29:48 +0200 Subject: [PATCH] etcd: increase message and transaction limits for embedded etcd --- channeldb/kvdb/etcd/db.go | 13 +++++++------ channeldb/kvdb/etcd/embed.go | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/channeldb/kvdb/etcd/db.go b/channeldb/kvdb/etcd/db.go index 3bd89c29..6089ab71 100644 --- a/channeldb/kvdb/etcd/db.go +++ b/channeldb/kvdb/etcd/db.go @@ -174,12 +174,13 @@ func newEtcdBackend(config BackendConfig) (*db, error) { } cli, err := clientv3.New(clientv3.Config{ - Context: config.Ctx, - Endpoints: []string{config.Host}, - DialTimeout: etcdConnectionTimeout, - Username: config.User, - Password: config.Pass, - TLS: tlsConfig, + Context: config.Ctx, + Endpoints: []string{config.Host}, + DialTimeout: etcdConnectionTimeout, + Username: config.User, + Password: config.Pass, + TLS: tlsConfig, + MaxCallSendMsgSize: 16384*1024 - 1, }) if err != nil { diff --git a/channeldb/kvdb/etcd/embed.go b/channeldb/kvdb/etcd/embed.go index 96ea71ab..3e6b9b16 100644 --- a/channeldb/kvdb/etcd/embed.go +++ b/channeldb/kvdb/etcd/embed.go @@ -42,7 +42,8 @@ func NewEmbeddedEtcdInstance(path string) (*BackendConfig, func(), error) { cfg.Dir = path // To ensure that we can submit large transactions. - cfg.MaxTxnOps = 1000 + cfg.MaxTxnOps = 8192 + cfg.MaxRequestBytes = 16384 * 1024 // Listen on random free ports. clientURL := fmt.Sprintf("127.0.0.1:%d", getFreePort())