pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid crashing when we have problems unlinking files post-commit 4+ messages / 1 participants [nested] [flat]
* pgsql: Avoid crashing when we have problems unlinking files post-commit @ 2011-12-20 20:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2011-12-20 20:01 UTC (permalink / raw) To: pgsql-committers Avoid crashing when we have problems unlinking files post-commit. smgrdounlink takes care to not throw an ERROR if it fails to unlink something, but that caution was rendered useless by commit 3396000684b41e7e9467d1abc67152b39e697035, which put an smgrexists call in front of it; smgrexists *does* throw error if anything looks funny, such as getting a permissions error from trying to open the file. If that happens post-commit, you get a PANIC, and what's worse the same logic appears in the WAL replay code, so the database even fails to restart. Restore the intended behavior by removing the smgrexists call --- it isn't accomplishing anything that we can't do better by adjusting mdunlink's ideas of whether it ought to warn about ENOENT or not. Per report from Joseph Shraibman of unrecoverable crash after trying to drop a table whose FSM fork had somehow gotten chmod'd to 000 permissions. Backpatch to 8.4, where the bogus coding was introduced. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/d0024cd1881447fa7aed58db94df379e593c6630 Modified Files -------------- src/backend/access/transam/twophase.c | 3 +-- src/backend/access/transam/xact.c | 14 ++++---------- src/backend/catalog/storage.c | 3 +-- src/backend/storage/smgr/md.c | 26 ++++++++++++++------------ 4 files changed, 20 insertions(+), 26 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid crashing when we have problems unlinking files post-commit @ 2011-12-20 20:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2011-12-20 20:01 UTC (permalink / raw) To: pgsql-committers Avoid crashing when we have problems unlinking files post-commit. smgrdounlink takes care to not throw an ERROR if it fails to unlink something, but that caution was rendered useless by commit 3396000684b41e7e9467d1abc67152b39e697035, which put an smgrexists call in front of it; smgrexists *does* throw error if anything looks funny, such as getting a permissions error from trying to open the file. If that happens post-commit, you get a PANIC, and what's worse the same logic appears in the WAL replay code, so the database even fails to restart. Restore the intended behavior by removing the smgrexists call --- it isn't accomplishing anything that we can't do better by adjusting mdunlink's ideas of whether it ought to warn about ENOENT or not. Per report from Joseph Shraibman of unrecoverable crash after trying to drop a table whose FSM fork had somehow gotten chmod'd to 000 permissions. Backpatch to 8.4, where the bogus coding was introduced. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/a63a7a5b091f8b833169476e8de18100fb1cb73d Modified Files -------------- src/backend/access/transam/twophase.c | 3 +-- src/backend/access/transam/xact.c | 14 ++++---------- src/backend/catalog/storage.c | 3 +-- src/backend/storage/smgr/md.c | 26 ++++++++++++++------------ 4 files changed, 20 insertions(+), 26 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid crashing when we have problems unlinking files post-commit @ 2011-12-20 20:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2011-12-20 20:01 UTC (permalink / raw) To: pgsql-committers Avoid crashing when we have problems unlinking files post-commit. smgrdounlink takes care to not throw an ERROR if it fails to unlink something, but that caution was rendered useless by commit 3396000684b41e7e9467d1abc67152b39e697035, which put an smgrexists call in front of it; smgrexists *does* throw error if anything looks funny, such as getting a permissions error from trying to open the file. If that happens post-commit, you get a PANIC, and what's worse the same logic appears in the WAL replay code, so the database even fails to restart. Restore the intended behavior by removing the smgrexists call --- it isn't accomplishing anything that we can't do better by adjusting mdunlink's ideas of whether it ought to warn about ENOENT or not. Per report from Joseph Shraibman of unrecoverable crash after trying to drop a table whose FSM fork had somehow gotten chmod'd to 000 permissions. Backpatch to 8.4, where the bogus coding was introduced. Branch ------ REL9_0_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/61dd2ffaff1be5768151e72aca030d7755255b26 Modified Files -------------- src/backend/access/transam/twophase.c | 3 +-- src/backend/access/transam/xact.c | 14 ++++---------- src/backend/catalog/storage.c | 9 ++++----- src/backend/storage/smgr/md.c | 26 ++++++++++++++------------ 4 files changed, 23 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Avoid crashing when we have problems unlinking files post-commit @ 2011-12-20 20:01 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2011-12-20 20:01 UTC (permalink / raw) To: pgsql-committers Avoid crashing when we have problems unlinking files post-commit. smgrdounlink takes care to not throw an ERROR if it fails to unlink something, but that caution was rendered useless by commit 3396000684b41e7e9467d1abc67152b39e697035, which put an smgrexists call in front of it; smgrexists *does* throw error if anything looks funny, such as getting a permissions error from trying to open the file. If that happens post-commit, you get a PANIC, and what's worse the same logic appears in the WAL replay code, so the database even fails to restart. Restore the intended behavior by removing the smgrexists call --- it isn't accomplishing anything that we can't do better by adjusting mdunlink's ideas of whether it ought to warn about ENOENT or not. Per report from Joseph Shraibman of unrecoverable crash after trying to drop a table whose FSM fork had somehow gotten chmod'd to 000 permissions. Backpatch to 8.4, where the bogus coding was introduced. Branch ------ REL8_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/ae25b3ba86b4a7a389cc6b90624bcefa1c887879 Modified Files -------------- src/backend/access/transam/twophase.c | 3 +-- src/backend/access/transam/xact.c | 14 ++++---------- src/backend/catalog/storage.c | 9 ++++----- src/backend/storage/smgr/md.c | 21 ++++++++++++--------- 4 files changed, 21 insertions(+), 26 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-12-20 20:01 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2011-12-20 20:01 pgsql: Avoid crashing when we have problems unlinking files post-commit Tom Lane <tgl@sss.pgh.pa.us> 2011-12-20 20:01 pgsql: Avoid crashing when we have problems unlinking files post-commit Tom Lane <tgl@sss.pgh.pa.us> 2011-12-20 20:01 pgsql: Avoid crashing when we have problems unlinking files post-commit Tom Lane <tgl@sss.pgh.pa.us> 2011-12-20 20:01 pgsql: Avoid crashing when we have problems unlinking files post-commit Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox