forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit51c24d9
committed
Fix ordering issue with WAL operations in GIN fast insert path
Contrary to what is documented in src/backend/access/transam/README,ginHeapTupleFastInsert() had a few ordering issues with the way it doesits WAL operations when inserting items in its fast path.First, when using a separate list, XLogBeginInsert() was being alwayscalled before START_CRIT_SECTION(), and in this case a second thing waswrong when merging lists, as an exclusive lock was taken on the tailpage *before* calling XLogBeginInsert(). Finally, when inserting itemsinto a tail page, the order of XLogBeginInsert() andSTART_CRIT_SECTION() was reversed. This commit addresses all theseissues by moving the calls of XLogBeginInsert() after all the pageslogged are locked and pinned, within a critical section.This has been applied first only on HEAD as of56b6625, but as perdiscussion with Tom Lane and Álvaro Herrera, a backpatch is preferred tokeep all the branches consistent and to respect the transam's READMEwhere we can.Author: Matthias van de Meent, Zhang MingliDiscussion:https://postgr.es/m/CAEze2WhL8uLMqynnnCu1LAPwxD5RKEo0nHV+eXGg_N6ELU88HQ@mail.gmail.comBackpatch-through: 101 parent475e9da commit51c24d9
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
284 | 284 |
| |
285 | 285 |
| |
286 | 286 |
| |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 | 287 |
| |
291 | 288 |
| |
292 | 289 |
| |
| |||
306 | 303 |
| |
307 | 304 |
| |
308 | 305 |
| |
| 306 | + | |
| 307 | + | |
| 308 | + | |
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
| |||
334 | 334 |
| |
335 | 335 |
| |
336 | 336 |
| |
| 337 | + | |
| 338 | + | |
337 | 339 |
| |
| 340 | + | |
338 | 341 |
| |
339 | 342 |
| |
340 | 343 |
| |
| |||
360 | 363 |
| |
361 | 364 |
| |
362 | 365 |
| |
| 366 | + | |
| 367 | + | |
363 | 368 |
| |
364 | 369 |
| |
365 | 370 |
| |
366 |
| - | |
367 |
| - | |
368 | 371 |
| |
369 | 372 |
| |
370 | 373 |
| |
|
0 commit comments
Comments
(0)