forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3d70127
committed
Perform an immediate shutdown if the postmaster.pid file is removed.
The postmaster now checks every minute or so (worst case, at most twominutes) that postmaster.pid is still there and still contains its own PID.If not, it performs an immediate shutdown, as though it had receivedSIGQUIT.The original goal behind this change was to ensure that failed buildfarmruns would get fully cleaned up, even if the test scripts had left apostmaster running, which is not an infrequent occurrence. When thebuildfarm script removes a test postmaster's $PGDATA directory, its nextcheck on postmaster.pid will fail and cause it to exit. Previously, manualintervention was often needed to get rid of such orphaned postmasters,since they'd block new test postmasters from obtaining the expected socketaddress.However, by checking postmaster.pid and not something else, we can provideadditional robustness: manual removal of postmaster.pid is a frequent DBAmistake, and now we can at least limit the damage that will ensue if a newpostmaster is started while the old one is still alive.Back-patch to all supported branches, since we won't get the desiredimprovement in buildfarm reliability otherwise.1 parentd25c7d7 commit3d70127
File tree
3 files changed
+115
-14
lines changed- src
- backend
- postmaster
- utils/init
- include
3 files changed
+115
-14
lines changedLines changed: 44 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1597 | 1597 |
| |
1598 | 1598 |
| |
1599 | 1599 |
| |
| 1600 | + | |
1600 | 1601 |
| |
1601 | 1602 |
| |
1602 |
| - | |
| 1603 | + | |
1603 | 1604 |
| |
1604 | 1605 |
| |
1605 | 1606 |
| |
| |||
1749 | 1750 |
| |
1750 | 1751 |
| |
1751 | 1752 |
| |
1752 |
| - | |
1753 |
| - | |
1754 |
| - | |
1755 |
| - | |
1756 |
| - | |
1757 |
| - | |
1758 |
| - | |
1759 |
| - | |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
1763 |
| - | |
1764 |
| - | |
1765 | 1753 |
| |
1766 | 1754 |
| |
1767 | 1755 |
| |
| |||
1788 | 1776 |
| |
1789 | 1777 |
| |
1790 | 1778 |
| |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
1791 | 1821 |
| |
1792 | 1822 |
| |
1793 | 1823 |
| |
|
Lines changed: 70 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1080 | 1080 |
| |
1081 | 1081 |
| |
1082 | 1082 |
| |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
1083 | 1153 |
| |
1084 | 1154 |
| |
1085 | 1155 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
443 | 443 |
| |
444 | 444 |
| |
445 | 445 |
| |
| 446 | + | |
446 | 447 |
| |
447 | 448 |
| |
448 | 449 |
| |
|
0 commit comments
Comments
(0)