multi: add global log for wallet db postgres back

This commit is contained in:
ziggie
2025-04-16 16:31:24 +02:00
parent 06f1ef47fa
commit 947702f6de
7 changed files with 70 additions and 4 deletions

View File

@@ -443,12 +443,21 @@ func (db *DB) GetBackends(ctx context.Context, chanDBPath,
}
closeFuncs[NSTowerServerDB] = postgresTowerServerBackend.Close
// The wallet subsystem is still not robust enough to run it
// without a single writer in postgres therefore we create a
// new config with the global lock enabled.
//
// NOTE: This is a temporary measure and should be removed as
// soon as the wallet code is more robust.
postgresConfigWalletDB := GetPostgresConfigKVDB(db.Postgres)
postgresConfigWalletDB.WithGlobalLock = true
postgresWalletBackend, err := kvdb.Open(
kvdb.PostgresBackendName, ctx,
postgresConfig, NSWalletDB,
postgresConfigWalletDB, NSWalletDB,
)
if err != nil {
return nil, fmt.Errorf("error opening postgres macaroon "+
return nil, fmt.Errorf("error opening postgres wallet "+
"DB: %v", err)
}
closeFuncs[NSWalletDB] = postgresWalletBackend.Close