forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc426f7c
committed
Fix assertion failure with REINDEX and event triggers
A REINDEX CONCURRENTLY run on a table with no indexes would always popthe topmost snapshot from the active snapshot stack, making the snapshothandling inconsistent between the multiple-relation and single-relationcases. This commit slightly changes the snapshot stack handling so as asnapshot is popped only ReindexMultipleInternal() in this case after arelation has been reindexed, fixing a problem where an event triggerfunction may need a snapshot but does not have one. This also keeps theplaces where PopActiveSnapshot() is called closer to each other.While on it, this expands the existing tests to cover all the cases thatcould be faced with REINDEX commands and such event triggers, for one ormore relations, with or without indexes.This behavior is inconsistent since5dc92b8, but we've never had aneed for an active snapshot at the end of a REINDEX until now.Thanks also to Jian He for the input.Reported-by: Alexander LakhinDiscussion:https://postgr.es/m/cb538743-484c-eb6a-a8c5-359980cd3a17@gmail.com1 parentc2a465b commitc426f7c
File tree
3 files changed
+99
-3
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+99
-3
lines changedLines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3347 | 3347 |
| |
3348 | 3348 |
| |
3349 | 3349 |
| |
| 3350 | + | |
| 3351 | + | |
3350 | 3352 |
| |
3351 | 3353 |
| |
3352 | 3354 |
| |
| |||
3698 | 3700 |
| |
3699 | 3701 |
| |
3700 | 3702 |
| |
3701 |
| - | |
3702 |
| - | |
3703 | 3703 |
| |
3704 |
| - | |
3705 | 3704 |
| |
3706 | 3705 |
| |
3707 | 3706 |
| |
|
Lines changed: 52 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
581 | 581 |
| |
582 | 582 |
| |
583 | 583 |
| |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
584 | 590 |
| |
585 | 591 |
| |
586 | 592 |
| |
| |||
602 | 608 |
| |
603 | 609 |
| |
604 | 610 |
| |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
605 | 655 |
| |
606 | 656 |
| |
607 | 657 |
| |
| 658 | + | |
608 | 659 |
| |
| 660 | + | |
609 | 661 |
| |
610 | 662 |
| |
611 | 663 |
| |
|
Lines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
443 | 443 |
| |
444 | 444 |
| |
445 | 445 |
| |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
446 | 451 |
| |
| 452 | + | |
447 | 453 |
| |
448 | 454 |
| |
449 | 455 |
| |
| |||
455 | 461 |
| |
456 | 462 |
| |
457 | 463 |
| |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
458 | 501 |
| |
459 | 502 |
| |
460 | 503 |
| |
461 | 504 |
| |
| 505 | + | |
462 | 506 |
| |
| 507 | + | |
463 | 508 |
| |
464 | 509 |
| |
465 | 510 |
| |
|
0 commit comments
Comments
(0)