[pgpool-general: 1695] Re: inconsistent replication ...

Nozomi Anzai anzai at sraoss.co.jp
Wed May 8 17:19:03 JST 2013


Hi,

> hello,
> 
> we have just checked out pgpool in replication mode and found out that it can create some serious inconsistencies. here is an example:

Have you tried "log_statement_per_node"? You can know in which backend a
query was executed actually by this param.
http://www.pgpool.net/docs/latest/pgpool-en.html#LOG_PER_NODE_STATEMENT

It seems pgpool thinks backend 0 (5432) isn't working. The
command "pcp_node_info" shows you a backend's status (up or down).
If down, you have to attach the backend to pgpool.
http://www.pgpool.net/docs/latest/pgpool-en.html#pcp_node_info

pgpool.conf looks OK.

> hs �� hs-VirtualBox:~$ psql repl -p 9999
> psql (9.2.4)
> Type "help" for help.
> 
> repl=# CREATE TABLE t_test (id int4);			   <------ should be replicated
> CREATE TABLE
> repl=# 
> repl=# INSERT INTO t_test VALUES (1);
> INSERT 0 1
> repl=# \q
> hs �� hs-VirtualBox:~$ psql repl -p 9999
> psql (9.2.4)
> Type "help" for help.
> 
> repl=# INSERT INTO t_test VALUES (1);
> INSERT 0 1
> repl=# \q
> hs �� hs-VirtualBox:~$ psql repl -p 5432
> psql (9.2.4)
> Type "help" for help.
> 
> repl=# \d t_test
> Did not find any relation named "t_test".				<----- problem
> 
> repl=# \q
> hs �� hs-VirtualBox:~$ psql repl -p 5433
> psql (9.2.4)
> Type "help" for help.
> 
> repl=# \d t_test									<------ only one node has the data
>    Table "public.t_test"
> Column |  Type   | Modifiers 
> --------+---------+-----------
> id     | integer | 
> 
> 
> 
> port 9999 is running as pgpool …
> i have configured two databases … one is running on port 5432 one and one on 5433.
> 
> root �� hs-VirtualBox:/home/hs/src/pgpool-II-3.2.4# cat /usr/local/etc/pgpool.conf | grep -v '^#' | grep '^[a-z].*'
> listen_addresses = 'localhost'
> port = 9999
> socket_dir = '/tmp'
> pcp_port = 9898
> pcp_socket_dir = '/tmp'
> backend_hostname0 = 'localhost'
> backend_port0 = 5432
> backend_weight0 = 1
> backend_data_directory0 = '/home/hs/db'
> backend_flag0 = 'ALLOW_TO_FAILOVER'
> backend_hostname1 = 'localhost'
> backend_port1 = 5433
> backend_weight1 = 1
> backend_data_directory1 = '/home/hs/db2'
> backend_flag1 = 'ALLOW_TO_FAILOVER'
> enable_pool_hba = off
> pool_passwd = 'pool_passwd'
> authentication_timeout = 60
> ssl = off
> num_init_children = 32
> max_pool = 4
> child_life_time = 300
> child_max_connections = 0
> connection_life_time = 0
> client_idle_limit = 0
> log_destination = 'stderr'
> print_timestamp = on
> log_connections = off
> log_hostname = off
> log_statement = off
> log_per_node_statement = off
> log_standby_delay = 'none'
> syslog_facility = 'LOCAL0'
> syslog_ident = 'pgpool'
> debug_level = 1
> pid_file_name = '/tmp/pgpool.pid'
> logdir = '/tmp'
> connection_cache = on
> reset_query_list = 'ABORT; DISCARD ALL'
> replication_mode = true
> replicate_select = off
> insert_lock = on
> lobj_lock_table = ''
> replication_stop_on_mismatch = off
> failover_if_affected_tuples_mismatch = off
> load_balance_mode = true
> ignore_leading_white_space = on
> white_function_list = ''
> black_function_list = 'nextval,setval'
> master_slave_mode = off
> master_slave_sub_mode = 'slony'
> sr_check_period = 0
> sr_check_user = 'nobody'
> sr_check_password = ''
> delay_threshold = 0
> follow_master_command = ''
> parallel_mode = off
> pgpool2_hostname = ''
> system_db_hostname  = 'localhost'
> system_db_port = 5432 
> system_db_dbname = 'pgpool'
> system_db_schema = 'pgpool_catalog'
> system_db_user = 'pgpool'
> system_db_password = ''
> health_check_period = 0
> health_check_timeout = 20
> health_check_user = 'nobody'
> health_check_password = ''
> health_check_max_retries = 0
> health_check_retry_delay = 1
> failover_command = ''
> failback_command = ''
> fail_over_on_backend_error = on
> recovery_user = 'nobody'
> recovery_password = ''
> recovery_1st_stage_command = ''
> recovery_2nd_stage_command = ''
> recovery_timeout = 90
> client_idle_limit_in_recovery = 0
> use_watchdog = off 
> trusted_servers = ''
> delegate_IP = ''
> wd_hostname = ''
> wd_port = 9000
> wd_interval = 10
> ping_path = '/bin'
> ifconfig_path = '/sbin'
> if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'
> if_down_cmd = 'ifconfig eth0:0 down'
> arping_path = '/usr/sbin'           # arping command path
> arping_cmd = 'arping -U $_IP_$ -w 1'
> wd_life_point = 3
> wd_lifecheck_query = 'SELECT 1'
> relcache_expire = 0
> relcache_size = 256
> check_temp_table = on
> memory_cache_enabled = off
> memqcache_method = 'shmem'
> memqcache_memcached_host = 'localhost'
> memqcache_memcached_port = 11211
> memqcache_total_size = 67108864
> memqcache_max_num_cache = 1000000
> memqcache_expire = 0
> memqcache_auto_cache_invalidation = on
> memqcache_maxcache = 409600
> memqcache_cache_block_size = 1048576
> memqcache_oiddir = '/var/log/pgpool/oiddir'
> white_memqcache_table_list = ''
> black_memqcache_table_list = ''
> 
> 
> it seems to me that i have configured everything properly.
> replication mode is on … no failure has been reported in the logfile?
> can you help me? i would greatly appreciate some input here.
> 
> it seems it does not recognize the command.
> maybe i have missed out something important in the docs.
> 
> 	many thanks,
> 
> 		hans
> 
> 
> --
> Cybertec Schönig & Schönig GmbH
> Gröhrmühlgasse 26
> A-2700 Wiener Neustadt
> Web: http://www.postgresql-support.de
> 
> _______________________________________________
> pgpool-general mailing list
> pgpool-general �� pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


-- 
Nozomi Anzai
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list