diff options
author | seanc <seanc@FreeBSD.org> | 2003-02-20 04:12:55 +0800 |
---|---|---|
committer | seanc <seanc@FreeBSD.org> | 2003-02-20 04:12:55 +0800 |
commit | b01a5d9baa1ca6cca9ea3c3cda2c7869f2299b62 (patch) | |
tree | bdccb244ad10b13adebd66de81b4dab9e3a7eff1 /databases | |
parent | 721cb2a1c7eb92854f57ee884c64430c4b4f3470 (diff) | |
download | freebsd-ports-gnome-b01a5d9baa1ca6cca9ea3c3cda2c7869f2299b62.tar.gz freebsd-ports-gnome-b01a5d9baa1ca6cca9ea3c3cda2c7869f2299b62.tar.zst freebsd-ports-gnome-b01a5d9baa1ca6cca9ea3c3cda2c7869f2299b62.zip |
Add a patch fix a long standing bug in PostgreSQL with LISTEN/NOTIFY
queues and shutting down the database. Not bumping port revision, but if
you are having problems related to the above, update as necessary.
Submitted by: Larry Rosenman <ler@lerctr.org>
Diffstat (limited to 'databases')
13 files changed, 494 insertions, 0 deletions
diff --git a/databases/postgresql-devel-server/files/patch-src::backend::commands::async.c b/databases/postgresql-devel-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql-devel-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql7/files/patch-src::backend::commands::async.c b/databases/postgresql7/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql7/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql73-server/files/patch-src::backend::commands::async.c b/databases/postgresql73-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql73-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql73/files/patch-src::backend::commands::async.c b/databases/postgresql73/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql73/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql74-server/files/patch-src::backend::commands::async.c b/databases/postgresql74-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql74-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql80-server/files/patch-src::backend::commands::async.c b/databases/postgresql80-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql80-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql81-server/files/patch-src::backend::commands::async.c b/databases/postgresql81-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql81-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql82-server/files/patch-src::backend::commands::async.c b/databases/postgresql82-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql82-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql83-server/files/patch-src::backend::commands::async.c b/databases/postgresql83-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql83-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql84-server/files/patch-src::backend::commands::async.c b/databases/postgresql84-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql84-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql90-server/files/patch-src::backend::commands::async.c b/databases/postgresql90-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql90-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql91-server/files/patch-src::backend::commands::async.c b/databases/postgresql91-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql91-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + diff --git a/databases/postgresql92-server/files/patch-src::backend::commands::async.c b/databases/postgresql92-server/files/patch-src::backend::commands::async.c new file mode 100644 index 000000000000..78eea1eae01c --- /dev/null +++ b/databases/postgresql92-server/files/patch-src::backend::commands::async.c @@ -0,0 +1,38 @@ +*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002 +--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003 +*************** +*** 599,604 **** +--- 599,614 ---- + + if (notifyInterruptEnabled) + { ++ bool save_ImmediateInterruptOK = ImmediateInterruptOK; ++ ++ /* ++ * We may be called while ImmediateInterruptOK is true; turn it off ++ * while messing with the NOTIFY state. (We would have to save ++ * and restore it anyway, because PGSemaphore operations inside ++ * ProcessIncomingNotify() might reset it.) ++ */ ++ ImmediateInterruptOK = false; ++ + /* + * I'm not sure whether some flavors of Unix might allow another + * SIGUSR2 occurrence to recursively interrupt this routine. To +*************** +*** 626,631 **** +--- 636,648 ---- + elog(LOG, "Async_NotifyHandler: done"); + } + } ++ ++ /* ++ * Restore ImmediateInterruptOK, and check for interrupts if needed. ++ */ ++ ImmediateInterruptOK = save_ImmediateInterruptOK; ++ if (save_ImmediateInterruptOK) ++ CHECK_FOR_INTERRUPTS(); + } + else + { + |