pgpool-ii 3.7.1 segfaults, connecting to Aurora Postgres

时间:2018-01-23 19:34:07

标签: postgresql pgpool aurora

I have configured a new aurora postgres cluster, I compiled my own pgpool-ii 3.7.1 (./configure --with-openssl, linked against libpq for 9.6.5), and I followed the aurora pgpool instructions. I have been unable to connect to my aurora cluster.

I have verified that my credentials work, by connecting to the individual nodes. I have my pool_hba.conf and pool_passwd setup correctly. I am at a loss.

Command

$ psql -h localhost -U user staging
Password for user user:
psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

Config

listen_addresses = '*'
port = 5432
socket_dir = '/tmp'
pcp_listen_addresses = '*'
pcp_port = 9898
pcp_socket_dir = '/tmp'
listen_backlog_multiplier = 2
serialize_accept = off
backend_hostname0 = 'primary-host'
backend_port0 = 5432
backend_weight0 = 2
backend_flag0 = 'ALWAYS_MASTER'
backend_hostname1 = 'replica-host'
backend_port1 = 5432
backend_weight1 = 1
backend_flag1 = 'ALLOW_TO_FAILOVER'
enable_pool_hba = on
pool_passwd = 'pool_passwd'
authentication_timeout = 60
ssl = off
num_init_children = 4
max_pool = 4
child_life_time = 300
child_max_connections = 0
connection_life_time = 0
client_idle_limit = 0
log_destination = 'stderr'
log_line_prefix = '%t: pid %p: '
log_connections = on
log_hostname = on
log_statement = on
log_per_node_statement = on
log_standby_delay = 'if_over_threshold'
syslog_facility = 'LOCAL0'
syslog_ident = 'pgpool'
log_error_verbosity = default
log_min_messages = debug1
pid_file_name = '/var/run/pgpool/pgpool.pid'
logdir = '/var/log/pgpool'
connection_cache = on
reset_query_list = 'ABORT; DISCARD ALL'
replication_mode = off
replicate_select = off
insert_lock = off
lobj_lock_table = ''
replication_stop_on_mismatch = off
failover_if_affected_tuples_mismatch = off
load_balance_mode = on
ignore_leading_white_space = on
white_function_list = ''
black_function_list = 'currval,lastval,nextval,setval'
allow_sql_comments = off
master_slave_mode = on
master_slave_sub_mode = 'stream'
sr_check_period = 0
health_check_period1 = 0
health_check_timeout1 = 20
health_check_password1 = 'foo'
health_check_user1 = 'bar'
health_check_database1 = 'staging'
health_check_max_retries1 = 20
health_check_retry_delay1 = 1
connect_timeout1 = 10000
fail_over_on_backend_error = off
use_watchdog = off
clear_memqcache_on_escalation = on
check_temp_table = on
check_unlogged_table = on
memory_cache_enabled = off

Logs

2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  adding regex pattern for "black_function_list" pattern: ^currval$
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  adding regex pattern for "black_function_list" pattern: ^lastval$
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  adding regex pattern for "black_function_list" pattern: ^nextval$
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  adding regex pattern for "black_function_list" pattern: ^setval$
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  num_backends: 2 total_weight: 3.000000
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  backend 0 weight: 1431655764.666667 flag: 0002
2018-01-23 18:20:04: pid 15606: DEBUG:  initializing pool configuration
2018-01-23 18:20:04: pid 15606: DETAIL:  backend 1 weight: 715827882.333333 flag: 0001
2018-01-23 18:20:04: pid 15606: LOG:  reading status file: 0 th backend is set to down status
2018-01-23 18:20:04: pid 15606: DEBUG:  pool_coninfo_size: num_init_children (4) * max_pool (4) * MAX_NUM_BACKENDS(128) * sizeof(ConnectionInfo) (136) = 278528 bytes requested for shared memory
2018-01-23 18:20:04: pid 15606: DEBUG:  ProcessInfo: num_init_children (4) * sizeof(ProcessInfo) (32) = 128 bytes requested for shared memory
2018-01-23 18:20:04: pid 15606: DEBUG:  Request info are: sizeof(POOL_REQUEST_INFO) 5264 bytes requested for shared memory
2018-01-23 18:20:04: pid 15606: DEBUG:  Recovery management area: sizeof(int) 4 bytes requested for shared memory
2018-01-23 18:20:04: pid 15606: LOG:  Setting up socket for 0.0.0.0:5432
2018-01-23 18:20:04: pid 15606: LOG:  Setting up socket for :::5432
2018-01-23 18:20:04: pid 15608: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15606: LOG:  find_primary_node_repeatedly: waiting for finding a primary node
2018-01-23 18:20:04: pid 15610: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15606: DEBUG:  find_primary_node: ALWAYS_MASTER flag found. Returns node id: 0
2018-01-23 18:20:04: pid 15611: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15612: DEBUG:  I am PCP child with pid:15612
2018-01-23 18:20:04: pid 15614: DEBUG:  I am health check process pid:15614 DB node id:1
2018-01-23 18:20:04: pid 15614: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15613: DEBUG:  I am 15613
2018-01-23 18:20:04: pid 15613: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15609: DEBUG:  initializing backend status
2018-01-23 18:20:04: pid 15606: LOG:  pgpool-II successfully started. version 3.7.1 (amefuriboshi)
2018-01-23 18:20:07: pid 15608: DEBUG:  I am 15608 accept fd 7
2018-01-23 18:20:07: pid 15608: LOG:  new connection received
2018-01-23 18:20:07: pid 15608: DETAIL:  connecting host=localhost port=51224
2018-01-23 18:20:07: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:07: pid 15608: DETAIL:  Protocol Major: 1234 Minor: 5679 database:  user:
2018-01-23 18:20:07: pid 15608: DEBUG:  selecting backend connection
2018-01-23 18:20:07: pid 15608: DETAIL:  SSLRequest from client
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_write: to frontend: kind:N po:0
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_flush_it: flush size: 1
2018-01-23 18:20:07: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:07: pid 15608: DETAIL:  application_name: psql
2018-01-23 18:20:07: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:07: pid 15608: DETAIL:  Protocol Major: 3 Minor: 0 database: staging user: user
2018-01-23 18:20:07: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:07: pid 15608: DETAIL:  connecting 0 backend
2018-01-23 18:20:07: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:07: pid 15608: DETAIL:  skipping backend slot 0 because backend_status = 3
2018-01-23 18:20:07: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:07: pid 15608: DETAIL:  connecting 1 backend
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_flush_it: flush size: 84
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_read: read 13 bytes from backend 1
2018-01-23 18:20:07: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:07: pid 15608: DETAIL:  slot: 1 length: 12
2018-01-23 18:20:07: pid 15608: DEBUG:  authentication backend
2018-01-23 18:20:07: pid 15608: DETAIL:  auth kind:5
2018-01-23 18:20:07: pid 15608: DEBUG:  authentication backend
2018-01-23 18:20:07: pid 15608: DETAIL:  trying md5 authentication
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_write: to frontend: kind:R po:0
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:5
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:9
2018-01-23 18:20:07: pid 15608: DEBUG:  pool_flush_it: flush size: 13
2018-01-23 18:20:08: pid 15608: DEBUG:  I am 15608 accept fd 7
2018-01-23 18:20:08: pid 15608: LOG:  new connection received
2018-01-23 18:20:08: pid 15608: DETAIL:  connecting host=localhost port=51226
2018-01-23 18:20:08: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:08: pid 15608: DETAIL:  Protocol Major: 1234 Minor: 5679 database: staging user: staging
2018-01-23 18:20:08: pid 15608: DEBUG:  selecting backend connection
2018-01-23 18:20:08: pid 15608: DETAIL:  SSLRequest from client
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:N po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 1
2018-01-23 18:20:08: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:08: pid 15608: DETAIL:  application_name: psql
2018-01-23 18:20:08: pid 15608: DEBUG:  reading startup packet
2018-01-23 18:20:08: pid 15608: DETAIL:  Protocol Major: 3 Minor: 0 database: staging user: user
2018-01-23 18:20:08: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:08: pid 15608: DETAIL:  connecting 0 backend
2018-01-23 18:20:08: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:08: pid 15608: DETAIL:  skipping backend slot 0 because backend_status = 3
2018-01-23 18:20:08: pid 15608: DEBUG:  creating new connection to backend
2018-01-23 18:20:08: pid 15608: DETAIL:  connecting 1 backend
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 84
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_read: read 13 bytes from backend 1
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  slot: 1 length: 12
2018-01-23 18:20:08: pid 15608: DEBUG:  authentication backend
2018-01-23 18:20:08: pid 15608: DETAIL:  auth kind:5
2018-01-23 18:20:08: pid 15608: DEBUG:  authentication backend
2018-01-23 18:20:08: pid 15608: DETAIL:  trying md5 authentication
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:R po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:9
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 13
2018-01-23 18:20:08: pid 15608: DEBUG:  performing md5 authentication
2018-01-23 18:20:08: pid 15608: DETAIL:  DB node id: 1 salt: af79306f
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to backend: 1 kind:p
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 41
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_read: read 324 bytes from backend 1
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:R po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 9
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 26
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"application_name" value:"psql"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:22 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 27
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 25
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"client_encoding" value:"UTF8"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:21 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 26
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 23
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"DateStyle" value:"ISO, MDY"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:19 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 24
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 25
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"integer_datetimes" value:"on"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:21 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 26
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 27
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"IntervalStyle" value:"postgres"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:23 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 28
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 21
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"is_superuser" value:"off"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:17 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 22
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 25
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"server_encoding" value:"UTF8"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:21 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 26
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 25
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"server_version" value:"9.6.3"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:21 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 26
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 36
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"session_authorization" value:"user"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:32 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 37
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 35
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"standard_conforming_strings" value:"on"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:31 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 36
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:S po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  master slot: 1 length: 17
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  process parameter status
2018-01-23 18:20:08: pid 15608: DETAIL:  backend:1 name:"TimeZone" value:"UTC"
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:13 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 18
2018-01-23 18:20:08: pid 15608: DEBUG:  reading message length
2018-01-23 18:20:08: pid 15608: DETAIL:  slot: 1 length: 12
2018-01-23 18:20:08: pid 15608: DEBUG:  authentication backend
2018-01-23 18:20:08: pid 15608: DETAIL:  cp->info[i]:0x7f2d8538a088 pid:26375
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: kind:K po:0
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:1
2018-01-23 18:20:08: pid 15608: DEBUG:  sending backend key data
2018-01-23 18:20:08: pid 15608: DETAIL:  send pid 26375 to frontend
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:5
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_write: to frontend: length:4 po:9
2018-01-23 18:20:08: pid 15608: DEBUG:  pool_flush_it: flush size: 13
2018-01-23 18:20:08: pid 15606: DEBUG:  reaper handler
2018-01-23 18:20:08: pid 15606: WARNING:  child process with pid: 15608 was terminated by segmentation fault
2018-01-23 18:20:08: pid 15606: LOG:  fork a new child process with pid: 15624
2018-01-23 18:20:08: pid 15606: DEBUG:  reaper handler: exiting normally
2018-01-23 18:20:08: pid 15624: DEBUG:  initializing backend status

1 个答案:

答案 0 :(得分:0)

事实证明,pgpool并不总是删除状态文件/var/log/pgpool/pgpool.status。如果主服务器以前标记为down,则对主服务器发出查询的任何尝试都将导致段错误。

在短期内,解决方案是删除状态文件。已联系开发人员并将解决问题。