]> git.sesse.net Git - pr0n/commitdiff
When inserting multiple images at the same time, we could deadlock -- inserting
authorSteinar H. Gunderson <sesse@debian.org>
Sun, 30 Jul 2006 13:52:33 +0000 (15:52 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Sun, 30 Jul 2006 13:52:33 +0000 (15:52 +0200)
new rows into images would (due to the foreign key constraint) lock the corresponding
row in event using a shared lock, then the update (due to last_picture) would
upgrade the lock to exclusive, causing a deadlock later. To fix this, we move
last_picture into its own table; we could also lock it explicitly earlier, but
that would stall other transactions (and they can run for 10-15 seconds or so,
or perhaps even longer) so it is not desirable.


No differences found