pgq / skytools-legacy

Obsolete, see https://github.com/pgq/ for maintained code.
https://github.com/pgq/
Other
249 stars 86 forks source link

Bug with a branch node worker #21

Open Cybersurfer opened 11 years ago

Cybersurfer commented 11 years ago

I'm trying to setup root->branch replication using this guide (https://github.com/markokr/skytools/blob/master/doc/howto/londiste3_cascaded_rep_howto.txt)

Everything goes well until launching branch-node worker. It crashes immediately after startup 2013-01-17 17:00:15,052 5567 DEBUG init 2013-01-17 17:00:15,057 5568 DEBUG Connect 'db' to 'dbname=db2 host=127.0.0.1 port=5431 [...] ' 2013-01-17 17:00:15,062 5568 DEBUG exec_cmd: select * from pgq_node.get_consumer_state('replik a', 'londiste_db2') 2013-01-17 17:00:15,065 5568 DEBUG 100 Ok 2013-01-17 17:00:15,066 5568 DEBUG exec_cmd: select * from pgq_node.set_consumer_error('replik a', 'londiste_db2', NULL) 2013-01-17 17:00:15,066 5568 DEBUG 100 None 2013-01-17 17:00:15,067 5568 DEBUG Connect '_provider_db' to 'dbname=db1 host=127.0.0.1 [... ]' 2013-01-17 17:00:15,068 5568 DEBUG exec_cmd: select * from pgq_node.get_node_info('replika') 2013-01-17 17:00:15,074 5568 DEBUG 100 Ok 2013-01-17 17:00:15,086 5568 INFO pgq.maint_operations is installed 2013-01-17 17:00:15,087 5568 DEBUG Sync tables 2013-01-17 17:00:15,088 5568 DEBUG New event: id=1 / type=pgq.location-info / data=slave / ext ra1=replika 2013-01-17 17:00:15,088 5568 DEBUG got cascade event: pgq.location-info(slave) 2013-01-17 17:00:15,090 5568 DEBUG New event: id=2 / type=pgq.location-info / data=slave / ext ra1=replika 2013-01-17 17:00:15,090 5568 DEBUG got cascade event: pgq.location-info(slave) 2013-01-17 17:00:15,091 5568 DEBUG Connect 'db' to 'dbname=db2 host=127.0.0.1 port=5431 [...]' 2013-01-17 17:00:15,096 5568 DEBUG exec_cmd: select * from pgq_node.set_consumer_error('replika', 'londiste_db2', 'Writing to queue disabled') 2013-01-17 17:00:15,099 5568 DEBUG 100 Consumer londiste_db2 error = Writing to queue disabled 2013-01-17 17:00:15,099 5568 ERROR Job londiste_db2 got error on connection 'db': Writing to queue disabled. Query: select pgq.current_event_table('replika') Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/skytools-3.0/skytools/scripting.py", line 563, in run_func_safely return func() File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/cascade/consumer.py", line 199, in work return Consumer.work(self) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/consumer.py", line 280, in work self._launch_process_batch(db, batch_id, ev_list) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/consumer.py", line 309, in _launch_process_batch self.process_batch(db, batch_id, list) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/cascade/consumer.py", line 175, in process_batch self.finish_remote_batch(src_db, dst_db, tick_id) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/cascade/worker.py", line 362, in finish_remote_batch self.flush_events(dst_curs) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/cascade/worker.py", line 419, in flush_events bulk_insert_events(dst_curs, self.ev_buf, flds, st.target_queue) File "/usr/lib/pymodules/python2.7/skytools-3.0/pgq/producer.py", line 31, in bulk_insert_events curs.execute(q, [queue_name]) File "/usr/lib/python2.7/dist-packages/psycopg2/extras.py", line 123, in execute return _cursor.execute(self, query, vars) InternalError: Writing to queue disabled

Both DBs are on the same server

Test server configuration: Ubuntu 12.04 LTS PostgreSQL 9.1.5 Skytools 3.1.2 Python 2.7.3 psycopg2 2.4.5

Ini files:

cat pgqd.ini [pgqd] database_list = db1,db2 logfile = /tmp/pgqd.log pidfile = /tmp/pgqd.pid

cat db1.ini [londiste3] job_name = londiste_db1 db = dbname=db1 host=127.0.0.1 port=5431 password=***** queue_name = replika logfile = /tmp/%(job_name)s.log pidfile = /tmp/%(job_name)s.pid

pgq_autocommit = 1 pgq_lazy_fetch = 0

cat db2.ini [londiste3] job_name = londiste_db2 db = dbname=db2 host=127.0.0.1 port=5431 password=***** queue_name = replika logfile = /tmp/%(job_name)s.log pidfile = /tmp/%(job_name)s.pid

pgq_autocommit = 1 pgq_lazy_fetch = 0

Cybersurfer commented 11 years ago

It seems to be an issue with pgbouncer (1.4.2) Direct connection works fine

Cybersurfer commented 11 years ago

Got same error with pgbouncer 1.5.4