Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/lnd/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ db.postgres.timeout=0
Connection timeout is disabled, to account for situations where the database
might be slow for unexpected reasons.

Moreover for particular kv tables we also add the option to access the
tables via a global lock (single wirter). This is a temorpary measure until
these particular tables have a native sql schema. This helps to mitigate
resource exhaustion in case LND experiencing high concurrent load:

* `db.postgres.walletdb-with-global-lock=true` to run LND with a single writer
for the walletdb_kv table (default is true).
* `db.postgres.channeldb-with-global-lock=false` to run the channeldb_kv table
with a single writer (default is false).

## Important note about replication

In case a replication architecture is planned, streaming replication should be avoided, as the master does not verify the replica is indeed identical, but it will only forward the edits queue, and let the slave catch up autonomously; synchronous mode, albeit slower, is paramount for `lnd` data integrity across the copies, as it will finalize writes only after the slave confirmed successful replication.
Expand Down
9 changes: 9 additions & 0 deletions docs/lnd/release-notes/release-notes-0.20.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@

## Performance Improvements

* [Added new Postgres configuration
options](https://github.com/lightningnetwork/lnd/pull/10394)
`db.postgres.channeldb-with-global-lock` and
`db.postgres.walletdb-with-global-lock` to allow fine-grained control over
database concurrency. The channeldb global lock defaults to `false` to enable
concurrent access, while the wallet global lock defaults to `true` to maintain
safe single-writer behavior until the wallet subsystem is fully
concurrent-safe.

## Deprecations

# Technical and Architectural Updates
Expand Down