Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapply #8644 #9242

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8204ec1
Reapply "kvdb/postgres: remove global application level lock"
aakselrod Oct 30, 2024
d60600c
go.mod: use local kvdb to reapply removal of global postgres lock
aakselrod Oct 30, 2024
08d9f1f
batch: handle serialization errors correctly
aakselrod Nov 2, 2024
e81fa05
channeldb: handle errors in `delChannelEdgeUnsafe()`
aakselrod Nov 5, 2024
4d3fc0b
channeldb: handle errors in `putChanEdgePolicy()`
aakselrod Nov 6, 2024
53d0a0b
sqldb: handle "in aborted tx" errors as serialization errors
aakselrod Nov 6, 2024
f85b88b
sqldb: add "deadlock detected" to serialization errors
aakselrod Nov 15, 2024
f9aa797
sqldb: add "not enough elements in RWConflictPool" to serialization e…
aakselrod Nov 19, 2024
1c7da6f
lncfg: change default postgres maxconnections setting to 20
aakselrod Nov 15, 2024
2d367d1
Makefile: tune params for db-instance for postgres itests
aakselrod Nov 6, 2024
719811b
Makefile: log to file instead of console
aakselrod Nov 15, 2024
f8a4804
github workflow: save postgres log to zip file
aakselrod Nov 15, 2024
32dfbef
batch: don't batch requests in single tx for postgres
aakselrod Nov 15, 2024
2b4a49a
itest: fix flake in multi-hop payments
aakselrod Nov 18, 2024
fc44a64
channeldb: pass through error when shell node can't be created
aakselrod Nov 19, 2024
6b79e79
sqldb: increase max retries to 20 for serialization errors
aakselrod Nov 19, 2024
38f1237
wip: kvdb refactor to use mutex instead of panic
aakselrod Nov 20, 2024
c9dca65
testing: get goroutines from sweeper when deadlocked at shutdown
aakselrod Nov 20, 2024
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
15 changes: 13 additions & 2 deletions batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sync"

"github.com/lightningnetwork/lnd/kvdb"
"github.com/lightningnetwork/lnd/sqldb"
)

// errSolo is a sentinel error indicating that the requester should re-run the
Expand Down Expand Up @@ -55,8 +56,18 @@ func (b *batch) run() {
for i, req := range b.reqs {
err := req.Update(tx)
if err != nil {
failIdx = i
return err
// If we get a serialization error, we
// want the underlying SQL retry
// mechanism to retry the entire batch.
// Otherwise, we can succeed in an
// sqldb retry and still re-execute the
// failing request individually.
dbErr := sqldb.MapSQLError(err)
if !sqldb.IsSerializationError(dbErr) {
failIdx = i
}

return dbErr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want to return the non-mapped version? For when IsSerializationError is false.

}
}
return nil
Expand Down