forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita63a7a5
committed
Avoid crashing when we have problems unlinking files post-commit.
smgrdounlink takes care to not throw an ERROR if it fails to unlinksomething, but that caution was rendered useless by commit3396000, which put an smgrexists call infront of it; smgrexists *does* throw error if anything looks funny, suchas getting a permissions error from trying to open the file. If thathappens post-commit, you get a PANIC, and what's worse the same logicappears in the WAL replay code, so the database even fails to restart.Restore the intended behavior by removing the smgrexists call --- it isn'taccomplishing anything that we can't do better by adjusting mdunlink'sideas of whether it ought to warn about ENOENT or not.Per report from Joseph Shraibman of unrecoverable crash after trying todrop a table whose FSM fork had somehow gotten chmod'd to 000 permissions.Backpatch to 8.4, where the bogus coding was introduced.1 parentbb4cfeb commita63a7a5
File tree
4 files changed
+20
-26
lines changed- src/backend
- access/transam
- catalog
- storage/smgr
4 files changed
+20
-26
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1343 | 1343 |
| |
1344 | 1344 |
| |
1345 | 1345 |
| |
1346 |
| - | |
1347 |
| - | |
| 1346 | + | |
1348 | 1347 |
| |
1349 | 1348 |
| |
1350 | 1349 |
| |
|
Lines changed: 4 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4532 | 4532 |
| |
4533 | 4533 |
| |
4534 | 4534 |
| |
4535 |
| - | |
4536 |
| - | |
4537 |
| - | |
4538 |
| - | |
4539 |
| - | |
| 4535 | + | |
| 4536 | + | |
4540 | 4537 |
| |
4541 | 4538 |
| |
4542 | 4539 |
| |
| |||
4637 | 4634 |
| |
4638 | 4635 |
| |
4639 | 4636 |
| |
4640 |
| - | |
4641 |
| - | |
4642 |
| - | |
4643 |
| - | |
4644 |
| - | |
| 4637 | + | |
| 4638 | + | |
4645 | 4639 |
| |
4646 | 4640 |
| |
4647 | 4641 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
360 | 360 |
| |
361 | 361 |
| |
362 | 362 |
| |
363 |
| - | |
364 |
| - | |
| 363 | + | |
365 | 364 |
| |
366 | 365 |
| |
367 | 366 |
| |
|
Lines changed: 14 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
322 | 322 |
| |
323 | 323 |
| |
324 | 324 |
| |
325 |
| - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
326 | 332 |
| |
327 | 333 |
| |
328 | 334 |
| |
| |||
350 | 356 |
| |
351 | 357 |
| |
352 | 358 |
| |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 |
| |
361 | 364 |
| |
362 | 365 |
| |
| |||
379 | 382 |
| |
380 | 383 |
| |
381 | 384 |
| |
| 385 | + | |
| 386 | + | |
| 387 | + | |
382 | 388 |
| |
383 | 389 |
| |
384 | 390 |
| |
| |||
410 | 416 |
| |
411 | 417 |
| |
412 | 418 |
| |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 |
| - | |
417 | 419 |
| |
418 | 420 |
| |
419 | 421 |
| |
|
0 commit comments
Comments
(0)