forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8270a0d
committed
Handle interrupts within a transaction context in REINDEX CONCURRENTLY
Phases 2 (building the new index) and 3 (validating the new index)checked for interrupts outside a transaction context, having asconsequence to not release session-level locks taken on the parentrelation and the old and new indexes processed. This could for examplebe triggered with statement_timeout and a bad timing, and would issueconfusing error messages when shutting down the session still holdingthe locks (note that an assertion failure would be triggered first), ontop of more issues with concurrent sessions trying to take a lock thatwould interfere with the SHARE UPDATE EXCLUSIVE locks hold here.This moves all the interruption checks inside a transaction context.Note that I have manually tested all interruptions to make sure thatinvalid indexes can be cleaned up properly. Partition indexes stillhave issues on their own with some missing dependency handling, whichwill be dealt with in a follow-up patch.Reported-by: Justin PryzbyAuthor: Michael PaquierDiscussion:https://postgr.es/m/20191013025145.GC4475@telsasoft.comBackpatch-through: 121 parent3b0c59a commit8270a0d
1 file changed
+25
-4
lines changedLines changed: 25 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3057 | 3057 |
| |
3058 | 3058 |
| |
3059 | 3059 |
| |
3060 |
| - | |
3061 |
| - | |
3062 | 3060 |
| |
3063 | 3061 |
| |
3064 | 3062 |
| |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
3065 | 3070 |
| |
3066 | 3071 |
| |
3067 | 3072 |
| |
| |||
3101 | 3106 |
| |
3102 | 3107 |
| |
3103 | 3108 |
| |
3104 |
| - | |
3105 |
| - | |
3106 | 3109 |
| |
3107 | 3110 |
| |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
3108 | 3118 |
| |
3109 | 3119 |
| |
3110 | 3120 |
| |
| |||
3166 | 3176 |
| |
3167 | 3177 |
| |
3168 | 3178 |
| |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
3169 | 3184 |
| |
3170 | 3185 |
| |
3171 | 3186 |
| |
| |||
3221 | 3236 |
| |
3222 | 3237 |
| |
3223 | 3238 |
| |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
3224 | 3244 |
| |
| 3245 | + | |
3225 | 3246 |
| |
3226 | 3247 |
| |
3227 | 3248 |
| |
|
0 commit comments
Comments
(0)