no-assert-for-startup-process-buffer-leak-0.1.patch
text/x-diff
Filename: no-assert-for-startup-process-buffer-leak-0.1.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/storage/buffer/bufmgr.c | 8 | 1 |
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 01eabe5..d814229 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -2473,7 +2473,14 @@ AtProcExit_Buffers(int code, Datum arg) AbortBufferIO(); UnlockBuffers(); - CheckForBufferLeaks(); + /* + * The startup process might fail to release buffer pins if it fatals out. + * Since that will result in postmaster shutdown anyway, there's not + * really a reason to work hard to prevent it; but let's not raise an + * assertion failure when it happens. + */ + if (code == 0 || !AmStartupProcess()) + CheckForBufferLeaks(); /* localbuf.c needs a chance too */ AtProcExit_LocalBuffers();