- Notifications
You must be signed in to change notification settings - Fork28
Commitfd83c83
committed
Fix deadlock in GIN vacuum introduced by218f515
Before218f515 if posting tree page is about to be deleted, then the wholeposting tree is locked by LockBufferForCleanup() on root preventing all theconcurrent inserts.218f515 reduced locking to the subtree containingpage to be deleted. However, due to concurrent parent split, inserter doesn'talways holds pins on all the pages constituting path from root to the targetleaf page. That could cause a deadlock between GIN vacuum process and GINinserter. And we didn't find non-invasive way to fix this.This commit reverts VACUUM behavior to lock the whole posting tree beforedelete any page. However, we keep another useful change by218f515: thetree is locked only if there are pages to be deleted.Reported-by: Chen HuajunDiagnosed-by: Chen Huajun, Andrey Borodin, Peter GeogheganDiscussion:https://postgr.es/m/31a702a.14dd.166c1366ac1.Coremail.chjischj%40163.comAuthor: Alexander Korotkov, based on ideas from Andrey Borodin and Peter GeogheganReviewed-by: Andrey BorodinBackpatch-through: 101 parent77d4d88 commitfd83c83
2 files changed
+73
-90
lines changedLines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
328 | 321 |
| |
329 | 322 |
| |
330 | 323 |
| |
|
Lines changed: 69 additions & 79 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
| 318 | + | |
| 319 | + | |
323 | 320 |
| |
324 | 321 |
| |
325 |
| - | |
| 322 | + | |
326 | 323 |
| |
327 | 324 |
| |
328 | 325 |
| |
329 | 326 |
| |
330 | 327 |
| |
331 | 328 |
| |
332 |
| - | |
333 |
| - | |
334 |
| - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
335 | 333 |
| |
336 |
| - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
337 | 338 |
| |
338 |
| - | |
| 339 | + | |
339 | 340 |
| |
340 |
| - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
341 | 359 |
| |
342 | 360 |
| |
343 | 361 |
| |
344 | 362 |
| |
345 | 363 |
| |
346 | 364 |
| |
347 |
| - | |
348 | 365 |
| |
349 | 366 |
| |
350 | 367 |
| |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
| 368 | + | |
374 | 369 |
| |
375 | 370 |
| |
376 | 371 |
| |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
| 372 | + | |
| 373 | + | |
384 | 374 |
| |
385 |
| - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
386 | 380 |
| |
387 |
| - | |
| 381 | + | |
| 382 | + | |
388 | 383 |
| |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
389 | 389 |
| |
390 |
| - | |
391 |
| - | |
| 390 | + | |
| 391 | + | |
392 | 392 |
| |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
393 | 397 |
| |
394 |
| - | |
395 |
| - | |
| 398 | + | |
| 399 | + | |
396 | 400 |
| |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 |
| - | |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
410 | 406 |
| |
411 |
| - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
412 | 410 |
| |
413 |
| - | |
| 411 | + | |
414 | 412 |
| |
415 |
| - | |
416 |
| - | |
417 |
| - | |
418 |
| - | |
419 |
| - | |
420 |
| - | |
| 413 | + | |
421 | 414 |
| |
422 |
| - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
423 | 420 |
| |
424 | 421 |
| |
425 |
| - | |
426 |
| - | |
| 422 | + | |
427 | 423 |
| |
428 | 424 |
| |
429 | 425 |
| |
430 |
| - | |
431 |
| - | |
432 |
| - | |
433 |
| - | |
434 |
| - | |
435 |
| - | |
436 | 426 |
| |
437 | 427 |
| |
438 | 428 |
| |
|
0 commit comments
Comments
(0)