Re: Sync Rep v17

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Daniel Farina <daniel(at)heroku(dot)com>
Subject: Re: Sync Rep v17
Date: 2011-02-22 19:43:29
Message-ID: AANLkTinmmPD_d4WnX8PqG111b_Q4UEBczbQtUMXZAwQ0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 19, 2011 at 11:26 PM, Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2011-02-22 19:45:30 Re: Sync Rep v17
Previous Message Robert Haas 2011-02-22 19:29:26 Re: Re: [COMMITTERS] pgsql: Make a hard state change from catchup to streaming mode.