[Pgpool-general] About deadlocks

Tatsuo Ishii t-ishii at sra.co.jp
Sun Aug 14 12:10:11 GMT 2005


> Hello,
> 
> I have been using pgpool without problems, but yesterday I started having a
> strange behaviour. After about 400 transactions against a replicated
> database, pgpool enters degenerated mode with the following error:
> 
> pgpool: 2005-08-10 12:49:27 ERROR: pid 14588: pool_check_fd: data is not
> ready tp->tv_sec 15 tp->tp_usec 15000000
> pgpool: 2005-08-10 12:49:27 ERROR: pid 14588: pool_process_query: secondary
> data is not ready at synchronous point. abort this session
> pgpool: 2005-08-10 12:49:27 ERROR: pid 14588: pool_process_query: kind does
> not match between backends master(T) secondary(
> 
> I was using replication_strict in "false". Because of this error, I tried
> increasing the timeout but same thing happened. I then tried changing
> replication_strict to "true" and it seems to work fine.
> 
> I've read in the documentation that setting replication_strict to "false"
> could lead to deadlocks, but I can't understand clearly what kind of
> deadlock may happen. Could anyone give a "clarifying" example for me?.
> Is the error log I posted caused by a deadlock?. I'm a bit confused.

Suppose in two sessions (session 0 and session 1), following queries are sent
to pgool.

   BEGIN;
   LOCK TABLE t1;
   END;

Here is a dead locking scenario:

Time t: on session 0 master server aquires lock on t1
t+1: on session 1 master server tries to aquire lock on t1, but
cannot. since session 0 already aquires the lock
t+2: on session 1 secondary server aquires lock on t1
t+3: on session 0 master server tries to aquire lock on t1, but
cannot. since session 1 already aquires the lock

	    master		       secondary
   session 0	session 1	session 0   session 1
   ------------------------------------------------------
   lock	
		lock
					     lock
				lock
   ------------------------------------------------------
--
Tatsuo Ishii


More information about the Pgpool-general mailing list