[Pgpool-general] is there a way out of degeneration mode
Tatsuo Ishii
ishii at sraoss.co.jp
Thu Jan 19 21:45:38 GMT 2006
Oh, I forgot you are using master/slave mode. In this mode UPDATE
etc.(DML) will not be sent to slave thus causes problems below. Let
me think again how to handle LISTEN/NOTIFY in master/slave mode...
--
Tatsuo Ishii
SRA OSS, Inc. Japan
> Thanks for looking into this.
> Unfortunately the patch doesn't work. Below is pgpool debug output when postgres
> sends a notify (after UPDATE test_table) and there's active listener.
>
> DEBUG: pid 3541: read kind from backend A
> DEBUG: pid 3541: pool_process_query: waiting for secondary for data ready
> ERROR: pid 3541: pool_check_fd: data is not ready tp->tv_sec 5 tp->tp_usec 5000000
> ERROR: pid 3541: pool_process_query: secondary data is not ready at synchronous point. abort this session
> ERROR: pid 3541: pool_process_query: kind does not match between backends master(A) secondary()
> LOG: pid 3541: do_child: exits with status 1 due to error
> DEBUG: pid 3498: reap_handler called
> DEBUG: pid 3498: child 3541 exits with status 256 by signal 0
> DEBUG: pid 3545: I am 3545
> DEBUG: pid 3498: fork a new child pid 3545
>
> Client that was listening for the notifies throwing the following error at the next query:
>
> users=# select 1;
> ERROR: kind mismatch between backends
> HINT: check data consistency between master and secondary
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
>
> Thanks,
> Michael
>
>
> On Wednesday 18 January 2006 06:30 pm, Tatsuo Ishii wrote:
> > > I see where there problem is. Sniffing shows it very clearly.
> > > When postgres sends asynchronous notification to pgpool it
> > > doesn't forward it to the client right away, but holds it until client
> > > requests something. Then it sends it along with a query result.
> > > I.e. you have to poll pgpool for notifies performing something like
> > > 'select 1' or any other query.
> > > So it works in your test and it works in my script if I add a query in the
> > > polling cycle.
> > > It's not very good because instead of polling local socket I have
> > > to issue a query that is actually executed on the backend server.
> > > Any way to have pgpool forward notifies asynchronously?
> > > Thanks,
> >
> > Oh, I got it. pgpool should process incoming notify messages from
> > backend while waiting for query from frontend.
> >
> > Can you try following patches?
> >
> > *** pool_process_query.c 5 Jan 2006 13:08:44 -0000 1.10
> > --- pool_process_query.c 18 Jan 2006 23:25:33 -0000
> > ***************
> > *** 857,863 ****
> > --- 857,866 ----
> > master_slave_dml = 0;
> > }
> >
> > + #ifdef NOT_USED
> > return ProcessFrontendResponse(frontend, backend);
> > + #endif
> > + return POOL_CONTINUE;
> > }
> >
> > --
> > Tatsuo Ishii
> > SRA OSS, Inc. Japan
> >
>
More information about the Pgpool-general
mailing list