forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitafb529e
committed
pg_basebackup: Fix code that thinks about LZ4 buffer size.
Before this patch, there was some code that tried to make sure that thebuffer was always big enough at the start, and then asserted that itdidn't need to be enlarged later. However, the code to make sure it wasbig enough at the start doesn't actually work, and therefore it waspossible to fail an assertion and crash later.Remove the code that tries to make sure the buffer is always big enoughat the start in favor of enlarging the buffer as we go along wheneverthat is necessary.The mistake probably happened because, on the server side, we doactually need to guarantee that the buffer is big enough at the startto avoid subsequent resizings. However, in that case, the callingcode makes promises about how much data it will provide at once, buthere, that's not the case.Report by Justin Pryzby. Analysis by me. Patch by Dipesh Pandit.Discussion:http://postgr.es/m/20220330143536.GG28503@telsasoft.com1 parent40af10b commitafb529e
1 file changed
+8
-14
lines changedLines changed: 8 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 | 76 |
| |
78 | 77 |
| |
79 | 78 |
| |
| |||
92 | 91 |
| |
93 | 92 |
| |
94 | 93 |
| |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 | 94 |
| |
107 | 95 |
| |
108 | 96 |
| |
| |||
170 | 158 |
| |
171 | 159 |
| |
172 | 160 |
| |
173 |
| - | |
174 | 161 |
| |
175 | 162 |
| |
176 | 163 |
| |
177 | 164 |
| |
178 | 165 |
| |
179 | 166 |
| |
180 | 167 |
| |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
181 | 172 |
| |
182 | 173 |
| |
183 | 174 |
| |
| |||
218 | 209 |
| |
219 | 210 |
| |
220 | 211 |
| |
221 |
| - | |
222 | 212 |
| |
223 | 213 |
| |
224 | 214 |
| |
| |||
227 | 217 |
| |
228 | 218 |
| |
229 | 219 |
| |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
230 | 224 |
| |
231 | 225 |
| |
232 | 226 |
| |
|
0 commit comments
Comments
(0)