lncfg+scripts: use configurable global lock for postgres backends

Replace hardcoded WithGlobalLock assignment with configurable
options wallet postgres backends. Also add the WithGlobalLock
option to the channeldb table for postgres backends.

Defaults:
- channeldb: false (allow concurrent access)
- wallet: true (maintain safe single-writer behavior)

Users can now override these defaults via:
- db.postgres.channeldb-with-global-lock
- db.postgres.walletdb-with-global-lock

This gives operators flexibility while maintaining safe defaults
until full native SQL migration is complete.

Moreover exclude db.postgres.walletdb-with-global-lock check
in the sample config file script. We cannot easily check the
correct default because we set it later in the LND startup
sequence so we exclude it.
This commit is contained in:
ziggie committed 2025-11-28 09:22:19 +01:00
1 parent 2e16efed30
commit 4f051d97ea
4 files changed
+42 -10

No files matched your search

+11
View File
@@ -1625,6 +1625,17 @@
; Whether to skip executing schema migrations.
; db.postgres.skipmigrations=false
; 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 native SQL.
; db.postgres.channeldb-with-global-lock=false
; Use a global lock for wallet database access. This is a temporary workaround
; until the wallet subsystem is upgraded to a native sql schema.
; db.postgres.walletdb-with-global-lock=true
; The maximum number of elements to use in a native-SQL batch query IN clause.
; db.postgres.query.max-batch-size=5000