forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite61efaf
committed
Fix race in TAP test 002_archiving.pl when restoring history file
This test, introduced indf86e52, uses a second standby to check thatit is able to remove correctly RECOVERYHISTORY and RECOVERYXLOG at theend of recovery. This standby uses the archives of the primary torestore its contents, with some of the archive's contents coming fromthe first standby previously promoted. In slow environments, it waspossible that the test did not check what it should, as the history filegenerated by the promotion of the first standby may not be stored yet onthe archives the second standby feeds on. So, it could be possible thatthe second standby selects an incorrect timeline, without restoring ahistory file at all.This commits adds a wait phase to make sure that the history filerequired by the second standby is archived before this cluster iscreated. This relies on poll_query_until() with pg_stat_file() and anabsolute path, something not supported in REL_10_STABLE.While on it, this adds a new test to check that the history file hasbeen restored by looking at the logs of the second standby. Thisensures that a RECOVERYHISTORY, whose removal needs to be checked,is created in the first place. This should make the test more robust.This test has been introduced bydf86e52, but it came in light as aneffect of the bug fixed byacf1dd4, where the extra restore_commandcalls made the test much slower.Reported-by: Andres FreundDiscussion:https://postgr.es/m/YlT23IvsXkGuLzFi@paquier.xyzBackpatch-through: 111 parent42e44f3 commite61efaf
1 file changed
+22
-5
lines changedLines changed: 22 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
| 28 | + | |
27 | 29 |
| |
28 | 30 |
| |
29 | 31 |
| |
| |||
81 | 83 |
| |
82 | 84 |
| |
83 | 85 |
| |
84 |
| - | |
85 |
| - | |
| 86 | + | |
| 87 | + | |
86 | 88 |
| |
87 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 |
| |
89 | 101 |
| |
90 | 102 |
| |
| |||
108 | 120 |
| |
109 | 121 |
| |
110 | 122 |
| |
| 123 | + | |
| 124 | + | |
| 125 | + | |
111 | 126 |
| |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
112 | 132 |
| |
113 | 133 |
| |
114 | 134 |
| |
115 | 135 |
| |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 | 136 |
| |
120 | 137 |
| |
121 | 138 |
| |
|
0 commit comments
Comments
(0)