forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit63a5822
committed
Try to handle torn reads of pg_control in frontend.
Some of our src/bin tools read the control file without any kind ofinterlocking against concurrent writes from the server. At least ext4and ntfs can expose partially modified contents when you do that.For now, we'll try to tolerate this by retrying up to 10 times if thechecksum doesn't match, until we get two reads in a row with the samebad checksum. This is not guaranteed to reach the right conclusion, butit seems very likely to. Thanks to Tom Lane for this suggestion.Various ideas for interlocking or atomicity were considered toocomplicated, unportable or expensive given the lack of field reports,but remain open for future reconsideration.Back-patch as far as 12. It doesn't seem like a good idea to put aheuristic change for a very rare problem into the final release of 11.Reviewed-by: Anton A. Melnikov <aamelnikov@inbox.ru>Reviewed-by: David Steele <david@pgmasters.net>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/20221123014224.xisi44byq3cf5psi%40awork3.anarazel.de1 parent4817da5 commit63a5822
1 file changed
+30
-0
lines changedLines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 |
| |
60 | 64 |
| |
61 | 65 |
| |
62 | 66 |
| |
63 | 67 |
| |
64 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 |
| |
66 | 76 |
| |
67 | 77 |
| |
| |||
117 | 127 |
| |
118 | 128 |
| |
119 | 129 |
| |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
120 | 150 |
| |
121 | 151 |
| |
122 | 152 |
| |
|
0 commit comments
Comments
(0)