forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8d28bf5
committed
Rework activation of commit timestamps during recovery
The activation and deactivation of commit timestamp tracking has notbeen handled consistently for a primary or standbys at recovery. Thefacility can be activated at three different moments of recovery:- The beginning, where a primary would use the GUC value for thedecision-making, and where a standby relies on the contents of thecontrol file.- When replaying a XLOG_PARAMETER_CHANGE record at redo.- The end, where both primary and standby rely on the GUC value.Using the GUC value for a primary at the beginning of recovery causesproblems with commit timestamp access when doing crash recovery.Particularly, when replaying transaction commits, it could be possiblethat an attempt to read commit timestamps is done for a transactionwhich committed at a moment when track_commit_timestamp was disabled.A test case is added to reproduce the failure. The test works down tov11 as it takes advantage of transaction commits within procedures.Reported-by: Hailong LiAuthor: Masahiko Sawasa, Michael PaquierReviewed-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.comBackpatch-through: 9.5, where commit timestamps have been introduced.1 parent1076335 commit8d28bf5
File tree
3 files changed
+40
-14
lines changed- src
- backend/access/transam
- test/modules/commit_ts/t
3 files changed
+40
-14
lines changedLines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
573 | 573 |
| |
574 | 574 |
| |
575 | 575 |
| |
576 |
| - | |
577 |
| - | |
578 |
| - | |
579 |
| - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
580 | 579 |
| |
581 | 580 |
| |
582 | 581 |
| |
| |||
586 | 585 |
| |
587 | 586 |
| |
588 | 587 |
| |
589 |
| - | |
| 588 | + | |
590 | 589 |
| |
591 | 590 |
| |
592 | 591 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6833 | 6833 |
| |
6834 | 6834 |
| |
6835 | 6835 |
| |
6836 |
| - | |
6837 |
| - | |
| 6836 | + | |
| 6837 | + | |
| 6838 | + | |
| 6839 | + | |
6838 | 6840 |
| |
6839 |
| - | |
6840 |
| - | |
| 6841 | + | |
6841 | 6842 |
| |
6842 | 6843 |
| |
6843 | 6844 |
| |
|
Lines changed: 31 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
75 | 74 |
| |
76 |
| - | |
77 | 75 |
| |
| 76 | + | |
| 77 | + | |
| 78 | + | |
78 | 79 |
| |
79 | 80 |
| |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
80 | 104 |
| |
81 | 105 |
| |
82 | 106 |
| |
| |||
106 | 130 |
| |
107 | 131 |
| |
108 | 132 |
| |
109 |
| - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
110 | 137 |
| |
111 | 138 |
| |
112 |
| - | |
113 | 139 |
| |
114 | 140 |
| |
115 | 141 |
| |
|
0 commit comments
Comments
(0)