You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/postgres.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,16 @@ db.postgres.timeout=0
42
42
Connection timeout is disabled, to account for situations where the database
43
43
might be slow for unexpected reasons.
44
44
45
+
Moreover for particular kv tables we also add the option to access the
46
+
tables via a global lock (single wirter). This is a temorpary measure until
47
+
these particular tables have a native sql schema. This helps to mitigate
48
+
resource exhaustion in case LND experiencing high concurrent load:
49
+
50
+
*`db.postgres.walletdb-with-global-lock=true` to run LND with a single writer
51
+
for the walletdb_kv table (default is true).
52
+
*`db.postgres.channeldb-with-global-lock=false` to run the channeldb_kv table
53
+
with a single writer (default is false).
54
+
45
55
## Important note about replication
46
56
47
57
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.
Timeout time.Duration`long:"timeout" description:"Database connection timeout. Set to zero to disable."`
49
+
MaxConnectionsint`long:"maxconnections" description:"The maximum number of open connections to the database. Set to zero for unlimited."`
50
+
SkipMigrationsbool`long:"skipmigrations" description:"Skip applying migrations on startup."`
51
+
ChannelDBWithGlobalLockbool`long:"channeldb-with-global-lock" description:"Use a global lock for channeldb access. This ensures only a single writer at a time but reduces concurrency. This is a temporary workaround until the revocation log is migrated to a native sql schema."`
52
+
WalletDBWithGlobalLockbool`long:"walletdb-with-global-lock" description:"Use a global lock for wallet database access. This ensures only a single writer at a time but reduces concurrency. This is a temporary workaround until the wallet subsystem is upgraded to a native sql schema."`
53
+
QueryConfig`group:"query" namespace:"query"`
52
54
}
53
55
54
56
// Validate checks that the PostgresConfig values are valid.
0 commit comments