- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit56b6625
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.Author: Matthias van de Meent, Zhang MingliDiscussion:https://postgr.es/m/CAEze2WhL8uLMqynnnCu1LAPwxD5RKEo0nHV+eXGg_N6ELU88HQ@mail.gmail.com1 parent63585b1 commit56b6625
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
285 | 285 |
| |
286 | 286 |
| |
287 | 287 |
| |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 | 288 |
| |
292 | 289 |
| |
293 | 290 |
| |
| |||
307 | 304 |
| |
308 | 305 |
| |
309 | 306 |
| |
| 307 | + | |
| 308 | + | |
| 309 | + | |
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
| 338 | + | |
| 339 | + | |
338 | 340 |
| |
| 341 | + | |
339 | 342 |
| |
340 | 343 |
| |
341 | 344 |
| |
| |||
361 | 364 |
| |
362 | 365 |
| |
363 | 366 |
| |
| 367 | + | |
| 368 | + | |
364 | 369 |
| |
365 | 370 |
| |
366 | 371 |
| |
367 |
| - | |
368 |
| - | |
369 | 372 |
| |
370 | 373 |
| |
371 | 374 |
| |
|
0 commit comments
Comments
(0)