From 3d48dbdd556e5e74982a59a53e50c2d183a1edd8 Mon Sep 17 00:00:00 2001 From: elbandi Date: Sat, 9 Sep 2023 00:11:46 +0200 Subject: [PATCH 1/3] Allow multiple etcd hosts to be specified in db.etcd.host. --- kvdb/etcd/db.go | 3 ++- kvdb/etcd/fixture.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kvdb/etcd/db.go b/kvdb/etcd/db.go index acdda382b..03d93c620 100644 --- a/kvdb/etcd/db.go +++ b/kvdb/etcd/db.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "runtime" + "strings" "sync" "time" @@ -138,7 +139,7 @@ func NewEtcdClient(ctx context.Context, cfg Config) (*clientv3.Client, context.Context, func(), error) { clientCfg := clientv3.Config{ - Endpoints: []string{cfg.Host}, + Endpoints: strings.Split(cfg.Host, ","), DialTimeout: etcdConnectionTimeout, Username: cfg.User, Password: cfg.Pass, diff --git a/kvdb/etcd/fixture.go b/kvdb/etcd/fixture.go index d1ef6cd7b..b7a697fad 100644 --- a/kvdb/etcd/fixture.go +++ b/kvdb/etcd/fixture.go @@ -5,6 +5,7 @@ package etcd import ( "context" + "strings" "testing" "time" @@ -49,7 +50,7 @@ func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture { t.Cleanup(etcdCleanup) cli, err := clientv3.New(clientv3.Config{ - Endpoints: []string{config.Host}, + Endpoints: strings.Split(config.Host, ","), Username: config.User, Password: config.Pass, }) From a0ec4f24d6de11c7c23db364a5dfc4d6190db492 Mon Sep 17 00:00:00 2001 From: elbandi Date: Mon, 22 Jul 2024 10:35:14 +0200 Subject: [PATCH 2/3] docs: Add release note item --- docs/release-notes/release-notes-0.18.3.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/release-notes/release-notes-0.18.3.md b/docs/release-notes/release-notes-0.18.3.md index c3afe9600..f8f239702 100644 --- a/docs/release-notes/release-notes-0.18.3.md +++ b/docs/release-notes/release-notes-0.18.3.md @@ -87,6 +87,9 @@ commitment when the channel was force closed. * Commitment fees are now taken into account when [calculating the fee exposure threshold](https://github.com/lightningnetwork/lnd/pull/8824). +* [Allow](https://github.com/lightningnetwork/lnd/pull/8845) multiple etcd hosts + to be specified in db.etcd.host. + ## RPC Updates * [`xImportMissionControl`](https://github.com/lightningnetwork/lnd/pull/8779) From 6043ced5728d1f4a65d8e106cbc7c41cdbb1b618 Mon Sep 17 00:00:00 2001 From: elbandi Date: Wed, 31 Jul 2024 01:13:20 +0200 Subject: [PATCH 3/3] Add configuration description --- kvdb/etcd/config.go | 2 +- sample-lnd.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kvdb/etcd/config.go b/kvdb/etcd/config.go index 76ca264c9..e8cbaf98c 100644 --- a/kvdb/etcd/config.go +++ b/kvdb/etcd/config.go @@ -14,7 +14,7 @@ type Config struct { EmbeddedLogFile string `long:"embedded_log_file" description:"Optional log file to use for embedded instance logs. note: use for testing only."` - Host string `long:"host" description:"Etcd database host."` + Host string `long:"host" description:"Etcd database host. Supports multiple hosts separated by a comma."` User string `long:"user" description:"Etcd database user."` diff --git a/sample-lnd.conf b/sample-lnd.conf index e20b5ea8e..70251ea10 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -1374,7 +1374,7 @@ [etcd] -; Etcd database host. +; Etcd database host. Supports multiple hosts separated by a comma. ; Default: ; db.etcd.host= ; Example: