forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit82f1c3b
committed
Fix deadlock hazard in CREATE INDEX CONCURRENTLY
Multiple sessions doing CREATE INDEX CONCURRENTLY simultaneously aresupposed to be able to work in parallel, as evidenced by fixes in commitc3d09b3 specifically to support this case. In reality, one of thesessions would be aborted by a misterious "deadlock detected" error.Jeff Janes diagnosed that this is because of leftover snapshots used forsystem catalog scans -- this was broken by8aa3e47 keeping track of(registering) the catalog snapshot. To fix the deadlocks, it's enoughto de-register that snapshot prior to waiting.Backpatch to 9.4, which introduced MVCC catalog scans.Include an isolationtester spec that 8 out of 10 times reproduces thedeadlock with the unpatched code for me (Álvaro).Author: Jeff JanesDiagnosed-by: Jeff JanesReported-by: Jeremy FinzelDiscussion:https://postgr.es/m/CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg%40mail.gmail.com1 parenta84e90b commit82f1c3b
File tree
4 files changed
+63
-0
lines changed- src
- backend/commands
- test/isolation
- expected
- specs
4 files changed
+63
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
782 | 784 | | |
783 | 785 | | |
784 | 786 | | |
785 | 787 | | |
786 | 788 | | |
| 789 | + | |
787 | 790 | | |
788 | 791 | | |
789 | 792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments
Comments
(0)