Closed bastjan closed 2 years ago
How does this change ensure that all parallel reports are able to commit their changes at the end? For example, what happens when two reports (in parallel) create a new category?
It still can happen if two reports create a category at the same time. But it will happen way less frequently. With the old upsert the row was locked for every fact update. Now just if a new category/tenant is created.
The transactions are serialized with RW locks. If report A
commits fast enough to not trigger the deadlock detection report B
sees the row in existing
.
PostgeSQL has deadlock detection we can tune if we see deadlocks often because of the long transaction times.
Allows running many reports in parallel and reduces the chances of deadlocks.
Checklist
bug
,enhancement
,documentation
,change
,breaking
,dependency
as they show up in the changelog