Re: Synch Rep: communication between backends and walsender

From: Markus Wanner <markus(at)bluegap(dot)ch>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Synch Rep: communication between backends and walsender
Date: 2009-06-22 16:55:57
Message-ID: 4A3FB79D.2050107@bluegap.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Fujii Masao wrote:
> The perfect solution seems to be to remove SA_RESTART and handle EINTR
> in an appropriate way after every syscalls. But, this is very tough job and has
> much influence on whole source code, so I don't think that this should be done
> as part of synch rep.

Especially note Tom's valid concerns about third party code. OTOH
checking against error codes should be common practice. And the failure
can then clearly be located in the third party module, and not in Postgres.

> On the other hand, I think that a semaphore should be used instead of a signal
> at least for backends to wait for walsender. This would turn around
> the situation
> on HPUX in some degree. In this case, the remaining problem is that walsender
> cannot immediately wake up. But, since walsender wakes up periodically and
> that period can be tweaked (by new GUC wal_sender_delay), the overhead on
> HPUX might not be actually so big.

Hm.. does the walsender really wake up periodically? IIRC the
misbehavior discovered on HPUX is that select() gets restarted upon
signaled with SA_RESTART - with its full timeout, so that a steady rate
of signals would lock the walsender process within select() completely.
Or what else do you use for the walsender to wake up periodically?

However, my point is that I think you don't have to solve this problem.
It should rather be taken care of by core. We can then pick up whatever
solution is decided on.

Just my 2c.

Regards

Markus Wanner

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-22 17:00:04 Re: 8.4 open item: copy performance regression?
Previous Message Andrew Dunstan 2009-06-22 16:42:47 Re: 8.4 open item: copy performance regression?