forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit53fe7e6
committed
Harden postgres_fdw tests against unexpected cache flushes.
postgres_fdw will close its remote session if an sinval cache resetoccurs, since it's possible that that means some FDW parameterschanged. We had two tests that were trying to ensure that thesession remains alive by setting debug_discard_caches = 0; butthat's not sufficient. Even though the tests seem stable enoughin the buildfarm, they flap a lot under CI.In the first test, which is checking the ability to recover froma lost connection, we can stabilize the results by just notcaring whether pg_terminate_backend() finds a victim backend.If a reset did happen, there won't be a session to terminateanymore, but the test can proceed anyway. (Arguably, we arethen not testing the unintentional-disconnect case, but as longas that scenario is exercised in most runs I think it's fine;testing the reset-driven case is of value too.)In the second test, which is trying to verify the application_namedisplayed in pg_stat_activity by a remote session, we had a racecondition in that the remote session might go away before we canfetch its pg_stat_activity entry. We can close that race and makethe test more certainly test what it intends to by arranging thingsso that the remote session itself fetches its pg_stat_activity entry(based on PID rather than a somewhat-circular assumption about theapplication name).Both tests now demonstrably pass under debug_discard_caches = 1,so we can remove that hack.Back-patch into relevant back branches.Discussion:https://postgr.es/m/20230226194340.u44bkfgyz64c67i6@awork3.anarazel.de1 parent46647cc commit53fe7e6
File tree
2 files changed
+64
-81
lines changed- contrib/postgres_fdw
- expected
- sql
2 files changed
+64
-81
lines changedLines changed: 38 additions & 56 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9926 | 9926 |
| |
9927 | 9927 |
| |
9928 | 9928 |
| |
9929 |
| - | |
9930 |
| - | |
9931 |
| - | |
9932 |
| - | |
9933 |
| - | |
9934 | 9929 |
| |
9935 | 9930 |
| |
9936 | 9931 |
| |
| |||
9939 | 9934 |
| |
9940 | 9935 |
| |
9941 | 9936 |
| |
9942 |
| - | |
| 9937 | + | |
| 9938 | + | |
| 9939 | + | |
| 9940 | + | |
9943 | 9941 |
| |
9944 |
| - | |
9945 |
| - | |
9946 |
| - | |
9947 |
| - | |
9948 |
| - | |
| 9942 | + | |
9949 | 9943 |
| |
9950 | 9944 |
| |
9951 | 9945 |
| |
| |||
9958 | 9952 |
| |
9959 | 9953 |
| |
9960 | 9954 |
| |
9961 |
| - | |
| 9955 | + | |
| 9956 | + | |
9962 | 9957 |
| |
9963 |
| - | |
9964 |
| - | |
9965 |
| - | |
9966 |
| - | |
9967 |
| - | |
| 9958 | + | |
9968 | 9959 |
| |
9969 | 9960 |
| |
9970 | 9961 |
| |
9971 | 9962 |
| |
9972 | 9963 |
| |
9973 | 9964 |
| |
9974 | 9965 |
| |
9975 |
| - | |
9976 | 9966 |
| |
9977 | 9967 |
| |
9978 | 9968 |
| |
| |||
11629 | 11619 |
| |
11630 | 11620 |
| |
11631 | 11621 |
| |
11632 |
| - | |
11633 |
| - | |
11634 |
| - | |
| 11622 | + | |
| 11623 | + | |
| 11624 | + | |
| 11625 | + | |
| 11626 | + | |
| 11627 | + | |
| 11628 | + | |
| 11629 | + | |
| 11630 | + | |
| 11631 | + | |
| 11632 | + | |
| 11633 | + | |
| 11634 | + | |
11635 | 11635 |
| |
11636 | 11636 |
| |
11637 |
| - | |
| 11637 | + | |
| 11638 | + | |
11638 | 11639 |
| |
11639 | 11640 |
| |
11640 | 11641 |
| |
11641 | 11642 |
| |
11642 | 11643 |
| |
11643 | 11644 |
| |
11644 |
| - | |
11645 |
| - | |
11646 |
| - | |
11647 |
| - | |
11648 |
| - | |
11649 |
| - | |
11650 |
| - | |
| 11645 | + | |
11651 | 11646 |
| |
11652 | 11647 |
| |
11653 | 11648 |
| |
11654 |
| - | |
11655 |
| - | |
11656 |
| - | |
| 11649 | + | |
| 11650 | + | |
| 11651 | + | |
11657 | 11652 |
| |
11658 | 11653 |
| |
11659 | 11654 |
| |
11660 | 11655 |
| |
| 11656 | + | |
11661 | 11657 |
| |
11662 |
| - | |
11663 |
| - | |
11664 |
| - | |
11665 |
| - | |
11666 |
| - | |
11667 |
| - | |
11668 |
| - | |
| 11658 | + | |
11669 | 11659 |
| |
11670 | 11660 |
| |
11671 | 11661 |
| |
11672 |
| - | |
11673 |
| - | |
11674 |
| - | |
| 11662 | + | |
| 11663 | + | |
| 11664 | + | |
11675 | 11665 |
| |
11676 | 11666 |
| |
| 11667 | + | |
11677 | 11668 |
| |
11678 |
| - | |
11679 |
| - | |
11680 |
| - | |
11681 |
| - | |
11682 |
| - | |
11683 |
| - | |
11684 |
| - | |
11685 |
| - | |
| 11669 | + | |
| 11670 | + | |
11686 | 11671 |
| |
11687 | 11672 |
| |
11688 | 11673 |
| |
11689 | 11674 |
| |
11690 | 11675 |
| |
11691 | 11676 |
| |
11692 |
| - | |
11693 |
| - | |
11694 |
| - | |
| 11677 | + | |
| 11678 | + | |
| 11679 | + | |
11695 | 11680 |
| |
11696 | 11681 |
| |
11697 |
| - | |
11698 |
| - | |
11699 |
| - | |
11700 | 11682 |
| |
11701 | 11683 |
| |
11702 | 11684 |
| |
|
Lines changed: 26 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3100 | 3100 |
| |
3101 | 3101 |
| |
3102 | 3102 |
| |
3103 |
| - | |
3104 |
| - | |
3105 |
| - | |
3106 |
| - | |
3107 |
| - | |
3108 |
| - | |
3109 | 3103 |
| |
3110 | 3104 |
| |
3111 | 3105 |
| |
3112 | 3106 |
| |
3113 |
| - | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
3114 | 3111 |
| |
| 3112 | + | |
3115 | 3113 |
| |
3116 | 3114 |
| |
3117 | 3115 |
| |
| |||
3121 | 3119 |
| |
3122 | 3120 |
| |
3123 | 3121 |
| |
3124 |
| - | |
| 3122 | + | |
| 3123 | + | |
3125 | 3124 |
| |
| 3125 | + | |
3126 | 3126 |
| |
3127 | 3127 |
| |
3128 | 3128 |
| |
3129 | 3129 |
| |
3130 | 3130 |
| |
3131 | 3131 |
| |
3132 | 3132 |
| |
3133 |
| - | |
3134 |
| - | |
3135 | 3133 |
| |
3136 | 3134 |
| |
3137 | 3135 |
| |
| |||
3850 | 3848 |
| |
3851 | 3849 |
| |
3852 | 3850 |
| |
3853 |
| - | |
3854 |
| - | |
3855 |
| - | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
3856 | 3861 |
| |
3857 | 3862 |
| |
3858 | 3863 |
| |
3859 |
| - | |
| 3864 | + | |
| 3865 | + | |
3860 | 3866 |
| |
3861 | 3867 |
| |
3862 | 3868 |
| |
3863 | 3869 |
| |
3864 | 3870 |
| |
3865 | 3871 |
| |
3866 |
| - | |
3867 |
| - | |
| 3872 | + | |
3868 | 3873 |
| |
3869 | 3874 |
| |
3870 | 3875 |
| |
3871 | 3876 |
| |
3872 | 3877 |
| |
3873 | 3878 |
| |
| 3879 | + | |
3874 | 3880 |
| |
3875 |
| - | |
3876 |
| - | |
| 3881 | + | |
3877 | 3882 |
| |
3878 | 3883 |
| |
3879 | 3884 |
| |
| 3885 | + | |
3880 | 3886 |
| |
3881 | 3887 |
| |
3882 |
| - | |
3883 |
| - | |
3884 |
| - | |
| 3888 | + | |
| 3889 | + | |
3885 | 3890 |
| |
3886 | 3891 |
| |
3887 | 3892 |
| |
3888 | 3893 |
| |
3889 | 3894 |
| |
3890 | 3895 |
| |
3891 | 3896 |
| |
3892 |
| - | |
3893 |
| - | |
3894 |
| - | |
3895 |
| - | |
3896 | 3897 |
| |
3897 | 3898 |
| |
3898 | 3899 |
| |
|
0 commit comments
Comments
(0)