On Sat, Feb 19, 2011 at 11:26 PM, Robert Haas <robertmh...@gmail.com> wrote:
>
> DEBUG:  write 0/3027BC8 flush 0/3014690 apply 0/3014690
> DEBUG:  released 0 procs up to 0/3014690
> DEBUG:  write 0/3027BC8 flush 0/3027BC8 apply 0/3014690
> DEBUG:  released 2 procs up to 0/3027BC8
> WARNING:  could not locate ourselves on wait queue
> 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: DEBUG:

you can make this happen more easily, i just run "pgbench -n -c10 -j10
test" and qot that warning and sometimes a segmentation fault and
sometimes a failed assertion

and the problematic code starts at
src/backend/replication/syncrep.c:277, here my suggestions on that
code.
still i get a failed assertion because of the second Assert (i think
we should just remove that one)

*************** SyncRepRemoveFromQueue(void)
*** 288,299 ****

                        if (proc->lwWaitLink == NULL)
                                elog(WARNING, "could not locate
ourselves on wait queue");
!                       proc = proc->lwWaitLink;
                }

                if (proc->lwWaitLink == NULL)   /* At tail */
                {
!                       Assert(proc == MyProc);
                        /* Remove ourselves from tail of queue */
                        Assert(queue->tail == MyProc);
                        queue->tail = proc;
--- 288,300 ----

                        if (proc->lwWaitLink == NULL)
                                elog(WARNING, "could not locate
ourselves on wait queue");
!                       else
!                               proc = proc->lwWaitLink;
                }

                if (proc->lwWaitLink == NULL)   /* At tail */
                {
!                       Assert(proc != MyProc);
                        /* Remove ourselves from tail of queue */
                        Assert(queue->tail == MyProc);
                        queue->tail = proc;

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to