- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb02fc7d
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 parentba58266 commitb02fc7d
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 | 279 |
| |
283 | 280 |
| |
284 | 281 |
| |
| |||
298 | 295 |
| |
299 | 296 |
| |
300 | 297 |
| |
| 298 | + | |
| 299 | + | |
| 300 | + | |
301 | 301 |
| |
302 | 302 |
| |
303 | 303 |
| |
| |||
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
| 329 | + | |
| 330 | + | |
329 | 331 |
| |
| 332 | + | |
330 | 333 |
| |
331 | 334 |
| |
332 | 335 |
| |
| |||
352 | 355 |
| |
353 | 356 |
| |
354 | 357 |
| |
| 358 | + | |
| 359 | + | |
355 | 360 |
| |
356 | 361 |
| |
357 | 362 |
| |
358 |
| - | |
359 |
| - | |
360 | 363 |
| |
361 | 364 |
| |
362 | 365 |
| |
|
0 commit comments
Comments
(0)