- Notifications
You must be signed in to change notification settings - Fork5
Commitaf4aba2
committed
Ensure recovery pause feature doesn't pause unless users can connect.
If we're not in hot standby mode, then there's no way for users to connectto reset the recoveryPause flag, so we shouldn't pause. The code was awareof this but the test to see if pausing was safe was seriously inadequate:it wasn't paying attention to reachedConsistency, and besides what it wastesting was that we could legally enter hot standby, not that we havedone so. Get rid of that in favor of checking LocalHotStandbyActive,which because of the coding in CheckRecoveryConsistency is tantamount tochecking that we have told the postmaster to enter hot standby.Also, move the recoveryPausesHere() call that reacts to asynchronousrecoveryPause requests so that it's not in the middle of application of aWAL record. I put it next to the recoveryStopsHere() call --- in futurethose are going to need to interact significantly, so this seems like agood waystation.Also, don't bother trying to read another WAL record if we've alreadydecided not to continue recovery. This was no big deal when the code waswritten originally, but now that reading a record might entail actions likefetching an archive file, it seems a bit silly to do it like that.Per report from Jeff Janes and subsequent discussion. The pause featureneeds quite a lot more work, but this gets rid of some indisputable bugs,and seems safe enough to back-patch.1 parentd67b06f commitaf4aba2
1 file changed
+34
-16
lines changedLines changed: 34 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5039 | 5039 |
| |
5040 | 5040 |
| |
5041 | 5041 |
| |
5042 |
| - | |
| 5042 | + | |
5043 | 5043 |
| |
5044 |
| - | |
| 5044 | + | |
| 5045 | + | |
| 5046 | + | |
5045 | 5047 |
| |
5046 | 5048 |
| |
5047 | 5049 |
| |
5048 | 5050 |
| |
| 5051 | + | |
| 5052 | + | |
| 5053 | + | |
| 5054 | + | |
5049 | 5055 |
| |
5050 | 5056 |
| |
5051 | 5057 |
| |
| |||
5806 | 5812 |
| |
5807 | 5813 |
| |
5808 | 5814 |
| |
5809 |
| - | |
5810 | 5815 |
| |
5811 | 5816 |
| |
5812 | 5817 |
| |
| |||
5848 | 5853 |
| |
5849 | 5854 |
| |
5850 | 5855 |
| |
| 5856 | + | |
| 5857 | + | |
| 5858 | + | |
| 5859 | + | |
| 5860 | + | |
| 5861 | + | |
| 5862 | + | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
| 5870 | + | |
| 5871 | + | |
5851 | 5872 |
| |
5852 | 5873 |
| |
5853 | 5874 |
| |
5854 | 5875 |
| |
5855 | 5876 |
| |
5856 |
| - | |
5857 |
| - | |
5858 |
| - | |
5859 |
| - | |
5860 |
| - | |
| 5877 | + | |
5861 | 5878 |
| |
5862 | 5879 |
| |
5863 | 5880 |
| |
5864 | 5881 |
| |
5865 | 5882 |
| |
5866 | 5883 |
| |
| 5884 | + | |
| 5885 | + | |
5867 | 5886 |
| |
5868 | 5887 |
| |
5869 | 5888 |
| |
| |||
5896 | 5915 |
| |
5897 | 5916 |
| |
5898 | 5917 |
| |
5899 |
| - | |
5900 | 5918 |
| |
5901 | 5919 |
| |
5902 |
| - | |
5903 |
| - | |
5904 |
| - | |
5905 |
| - | |
5906 |
| - | |
5907 |
| - | |
5908 | 5920 |
| |
5909 | 5921 |
| |
5910 | 5922 |
| |
| |||
5948 | 5960 |
| |
5949 | 5961 |
| |
5950 | 5962 |
| |
| 5963 | + | |
5951 | 5964 |
| |
5952 | 5965 |
| |
| 5966 | + | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
| 5970 | + | |
5953 | 5971 |
| |
5954 |
| - | |
| 5972 | + | |
5955 | 5973 |
| |
5956 | 5974 |
| |
5957 | 5975 |
| |
|
0 commit comments
Comments
(0)