mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-13 12:32:48 +02:00
kvdb/sqlbase: relax bulk migration isolation
This commit is contained in:
parent
f02cf4c470
commit
18bbdb5363
1 changed files with 6 additions and 1 deletions
|
|
@ -88,8 +88,13 @@ func (p *postgresDB) BeginBulk(ctx context.Context) (MigrationBulkKVTx, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// A bulk migration can touch millions of rows in a single transaction.
|
||||
// PostgreSQL retains predicate locks until a serializable transaction
|
||||
// ends, which can make its predicate lock table consume excessive memory.
|
||||
// Read committed is sufficient because the migration owns the empty
|
||||
// destination database while loading it.
|
||||
tx, err := conn.BeginTx(ctx, &sql.TxOptions{
|
||||
Isolation: sql.LevelSerializable,
|
||||
Isolation: sql.LevelReadCommitted,
|
||||
})
|
||||
if err != nil {
|
||||
locker.Unlock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue