Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48912ac

Browse files
committed
Disable triggering failover with a signal in pg_standby on Windows, because
Windows doesn't do signal processing like other platforms do. It neverreally worked, but recent changes to the signal handling made it crash.This fixes bug #4961. Patch by Fujii Masao.
1 parent91ce16a commit48912ac

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎contrib/pg_standby/pg_standby.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.26 2009/06/25 19:33:25 tgl Exp $
2+
* $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.27 2009/11/04 12:51:30 heikki Exp $
33
*
44
*
55
* pg_standby.c
@@ -56,7 +56,9 @@ booldebug = false;/* are we debugging? */
5656
boolneed_cleanup= false;/* do we need to remove files from
5757
* archive? */
5858

59+
#ifndefWIN32
5960
staticvolatilesig_atomic_tsignaled= false;
61+
#endif
6062

6163
char*archiveLocation;/* where to find the archive? */
6264
char*triggerPath;/* where to find the trigger file? */
@@ -535,13 +537,13 @@ usage(void)
535537
printf("\nReport bugs to <pgsql-bugs@postgresql.org>.\n");
536538
}
537539

540+
#ifndefWIN32
538541
staticvoid
539542
sighandler(intsig)
540543
{
541544
signaled= true;
542545
}
543546

544-
#ifndefWIN32
545547
/* We don't want SIGQUIT to core dump */
546548
staticvoid
547549
sigquit_handler(intsig)
@@ -573,6 +575,7 @@ main(int argc, char **argv)
573575
}
574576
}
575577

578+
#ifndefWIN32
576579
/*
577580
* You can send SIGUSR1 to trigger failover.
578581
*
@@ -584,10 +587,11 @@ main(int argc, char **argv)
584587
* out to be a bad idea because postmaster uses SIGQUIT to request
585588
* immediate shutdown. We still trap SIGINT, but that may change in a
586589
* future release.
590+
*
591+
* There's no way to trigger failover via signal on Windows.
587592
*/
588593
(void)signal(SIGUSR1,sighandler);
589594
(void)signal(SIGINT,sighandler);/* deprecated, use SIGUSR1 */
590-
#ifndefWIN32
591595
(void)signal(SIGQUIT,sigquit_handler);
592596
#endif
593597

@@ -763,6 +767,7 @@ main(int argc, char **argv)
763767
{
764768
/* Check for trigger file or signal first */
765769
CheckForExternalTrigger();
770+
#ifndefWIN32
766771
if (signaled)
767772
{
768773
Failover=FastFailover;
@@ -772,6 +777,7 @@ main(int argc, char **argv)
772777
fflush(stderr);
773778
}
774779
}
780+
#endif
775781

776782
/*
777783
* Check for fast failover immediately, before checking if the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp