Wouter,

Thank you for joining my talk and the bug report.

> Situation:
> - Primary and standby db are running fine 
> - Primary fails, pgpool promotes the standby to master
> - New master fails also, pgool craches

Ok, could you try included patches?

> BTW: Nice talk on fosdem

Thanks!
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

> See bellow for logging:
> 
> 2011-02-06 22:17:05 LOG:   pid 4915: pgpool-II successfully started. version 
> 3.1.0-alpha1 (umiyameboshi)
> 2011-02-06 22:17:05 LOG:   pid 4915: find_primary_node: primary node id is 0
> 
> 2011-02-06 22:17:55 ERROR: pid 4949: pool_read: EOF encountered with backend
> 2011-02-06 22:17:55 ERROR: pid 4949: do_query: error while reading message 
> kind
> 2011-02-06 22:17:55 ERROR: pid 4949: check_replication_time_lag: SELECT 
> pg_current_xlog_location() failed
> 2011-02-06 22:17:55 ERROR: pid 4915: connect_inet_domain_socket: connect() 
> failed: Connection refused
> 2011-02-06 22:17:55 ERROR: pid 4915: health check failed. 0 th host 
> dps-db1-3.infra.vasco.com at port 5433 is down
> 2011-02-06 22:17:55 LOG:   pid 4915: set 0 th backend down status
> 2011-02-06 22:17:55 LOG:   pid 4915: starting degeneration. shutdown host 
> dps-db1-3.infra.vasco.com(5433)
> 2011-02-06 22:17:55 LOG:   pid 4915: execute command: 
> /usr/local/bin/failover.sh 0 dps-db2-3.infra.vasco.com /tmp/trigger_file0
> 2011-02-06 22:17:55 LOG:   pid 4915: failover_handler: set new master node: 1
> 2011-02-06 22:17:55 LOG:   pid 4915: failover done. shutdown host 
> dps-db1-3.infra.vasco.com(5433)
> 2011-02-06 22:17:55 LOG:   pid 4915: find_primary_node: primary node id is 1
> 
> 2011-02-06 22:19:05 ERROR: pid 4915: connect_inet_domain_socket: connect() 
> failed: Connection refused
> 2011-02-06 22:19:05 ERROR: pid 4915: health check failed. 1 th host 
> dps-db2-3.infra.vasco.com at port 5433 is down
> 2011-02-06 22:19:05 LOG:   pid 4915: set 1 th backend down status
> 2011-02-06 22:19:05 LOG:   pid 4915: starting degeneration. shutdown host 
> dps-db2-3.infra.vasco.com(5433)
> 2011-02-06 22:19:05 ERROR: pid 4915: failover_handler: no valid DB node found
> Segmentation fault
> 
> 
> Attached also the config file
> 
> 
Index: main.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/main.c,v
retrieving revision 1.91
diff -c -r1.91 main.c
*** main.c	27 Jan 2011 07:55:28 -0000	1.91
--- main.c	9 Feb 2011 00:48:30 -0000
***************
*** 5,11 ****
   * pgpool: a language independent connection pool server for PostgreSQL
   * written by Tatsuo Ishii
   *
!  * Copyright (c) 2003-2010	PgPool Global Development Group
   *
   * Permission to use, copy, modify, and distribute this software and
   * its documentation for any purpose and without fee is hereby
--- 5,11 ----
   * pgpool: a language independent connection pool server for PostgreSQL
   * written by Tatsuo Ishii
   *
!  * Copyright (c) 2003-2011	PgPool Global Development Group
   *
   * Permission to use, copy, modify, and distribute this software and
   * its documentation for any purpose and without fee is hereby
***************
*** 1960,1966 ****
  BackendInfo *
  pool_get_node_info(int node_number)
  {
! 	if (node_number >= NUM_BACKENDS)
  		return NULL;
  
  	return &BACKEND_INFO(node_number);
--- 1960,1966 ----
  BackendInfo *
  pool_get_node_info(int node_number)
  {
! 	if (node_number < 0 || node_number >= NUM_BACKENDS)
  		return NULL;
  
  	return &BACKEND_INFO(node_number);
***************
*** 2224,2230 ****
  
  					case 'H': /* new master host name */
  						newmaster = pool_get_node_info(get_next_master_node());
! 						string_append_char(exec_cmd, newmaster->backend_hostname);
  						break;
  
  					case 'm': /* new master node id */
--- 2224,2234 ----
  
  					case 'H': /* new master host name */
  						newmaster = pool_get_node_info(get_next_master_node());
! 						if (newmaster)
! 							string_append_char(exec_cmd, newmaster->backend_hostname);
! 						else
! 							/* no vaid new master */
! 							string_append_char(exec_cmd, "");
  						break;
  
  					case 'm': /* new master node id */
_______________________________________________
Pgpool-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-general

Reply via email to