- Notifications
You must be signed in to change notification settings - Fork28
Commit1d96c1b
committed
Fix incorrect ordering of operations in pg_resetwal and pg_rewind.
Commitc37b3d0 dropped its added GetDataDirectoryCreatePerm call intothe wrong place in pg_resetwal.c, namely after the chdir to DataDir.That broke invocations using a relative path, as reported by Tushar Ahuja.We could have left it where it was and changed the argument to be ".",but that'd result in a rather confusing error message in event of afailure, so re-ordering seems like a better solution.Similarly reorder operations in pg_rewind.c. The issue there is thatit doesn't seem like a good idea to do any actual operations before thenot-root check (on Unix) or the restricted token acquisition (on Windows).I don't know that this is an actual bug, but I'm definitely not convincedthat it isn't, either.Assorted other code review forc37b3d0 andda9b580: fix somemisspelled or otherwise badly worded comments, put the #include for<sys/stat.h> where it actually belongs, etc.Discussion:https://postgr.es/m/aeb9c3a7-3c3f-a57f-1a18-c8d4fcdc2a1f@enterprisedb.com1 parentb06d8e5 commit1d96c1b
File tree
6 files changed
+26
-27
lines changed- src
- backend
- storage/file
- utils/init
- bin
- pg_resetwal
- pg_rewind
- common
- include/common
6 files changed
+26
-27
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3552 | 3552 |
| |
3553 | 3553 |
| |
3554 | 3554 |
| |
3555 |
| - | |
3556 |
| - | |
| 3555 | + | |
| 3556 | + | |
3557 | 3557 |
| |
3558 | 3558 |
| |
3559 | 3559 |
| |
| |||
3562 | 3562 |
| |
3563 | 3563 |
| |
3564 | 3564 |
| |
3565 |
| - | |
3566 |
| - | |
| 3565 | + | |
| 3566 | + | |
3567 | 3567 |
| |
3568 | 3568 |
| |
3569 | 3569 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
22 |
| - | |
23 | 21 |
| |
24 | 22 |
| |
25 | 23 |
| |
| |||
63 | 61 |
| |
64 | 62 |
| |
65 | 63 |
| |
66 |
| - | |
| 64 | + | |
67 | 65 |
| |
68 | 66 |
| |
69 | 67 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
356 | 356 |
| |
357 | 357 |
| |
358 | 358 |
| |
359 |
| - | |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 | 359 |
| |
367 | 360 |
| |
368 | 361 |
| |
| |||
373 | 366 |
| |
374 | 367 |
| |
375 | 368 |
| |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
376 | 376 |
| |
377 | 377 |
| |
378 | 378 |
| |
|
Lines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
186 | 186 |
| |
187 | 187 |
| |
188 | 188 |
| |
189 |
| - | |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 | 189 |
| |
200 | 190 |
| |
201 | 191 |
| |
| |||
214 | 204 |
| |
215 | 205 |
| |
216 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
217 | 217 |
| |
218 | 218 |
| |
219 | 219 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
14 |
| - | |
15 | 13 |
| |
| 14 | + | |
16 | 15 |
| |
17 | 16 |
| |
18 | 17 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
|
0 commit comments
Comments
(0)