forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc186ba1
committed
Ensure correct minimum consistent point on standbys
Startup process has improved its calculation of incorrect minimumconsistent point in8d68ee6, which ensures that all WAL available getsreplayed when doing crash recovery, and has introduced an incorrectcalculation of the minimum recovery point for non-startup processes,which can cause incorrect page references on a standby when for examplethe background writer flushed a couple of pages on-disk but was notupdating the control file to let a subsequent crash recovery replay towhere it should have.The only case where this has been reported to be a problem is when astandby needs to calculate the latest removed xid when replaying a btreedeletion record, so one would need connections on a standby that happenjust after recovery has thought it reached a consistent point. Using abackground worker which is started after the consistent point is reachedwould be the easiest way to get into problems if it connects to adatabase. Having clients which attempt to connect periodically couldalso be a problem, but the odds of seeing this problem are much lower.The fix used is pretty simple, as the idea is to give access to theminimum recovery point written in the control file to non-startupprocesses so as they use a reference, while the startup process stillinitializes its own references of the minimum consistent point so as theoriginal problem with incorrect page references happening post-promotionwith a crash do not show up.Reported-by: Alexander KukushkinDiagnosed-by: Alexander KukushkinAuthor: Michael PaquierReviewed-by: Kyotaro Horiguchi, Alexander KukushkinDiscussion:https://postgr.es/m/153492341830.1368.3936905691758473953@wrigleys.postgresql.orgBackpatch-through: 9.31 parentd9c366f commitc186ba1
1 file changed
+25
-6
lines changedLines changed: 25 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2723 | 2723 |
| |
2724 | 2724 |
| |
2725 | 2725 |
| |
2726 |
| - | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
2727 | 2731 |
| |
2728 |
| - | |
| 2732 | + | |
2729 | 2733 |
| |
2730 | 2734 |
| |
2731 | 2735 |
| |
| |||
2737 | 2741 |
| |
2738 | 2742 |
| |
2739 | 2743 |
| |
2740 |
| - | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2741 | 2747 |
| |
2742 | 2748 |
| |
2743 | 2749 |
| |
| |||
3127 | 3133 |
| |
3128 | 3134 |
| |
3129 | 3135 |
| |
3130 |
| - | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
3131 | 3139 |
| |
3132 |
| - | |
| 3140 | + | |
3133 | 3141 |
| |
3134 | 3142 |
| |
3135 | 3143 |
| |
| |||
3146 | 3154 |
| |
3147 | 3155 |
| |
3148 | 3156 |
| |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
3149 | 3165 |
| |
3150 |
| - | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
3151 | 3170 |
| |
3152 | 3171 |
| |
3153 | 3172 |
| |
|
0 commit comments
Comments
(0)