Skip to content

Commit

Permalink
Merge pull request #8845 from bitbandi/multiple-etcd-host
Browse files Browse the repository at this point in the history
Allow multiple etcd host
  • Loading branch information
guggero authored Jul 31, 2024
2 parents 72a36da + 6043ced commit 16d80f5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/release-notes/release-notes-0.18.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion kvdb/etcd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."`

Expand Down
3 changes: 2 additions & 1 deletion kvdb/etcd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"runtime"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion kvdb/etcd/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package etcd

import (
"context"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -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,
})
Expand Down
2 changes: 1 addition & 1 deletion sample-lnd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@

[etcd]

; Etcd database host.
; Etcd database host. Supports multiple hosts separated by a comma.
; Default:
; db.etcd.host=
; Example:
Expand Down

0 comments on commit 16d80f5

Please sign in to comment.