Re: Synch Rep: communication between backends and walsender

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

Hi,

On Sat, Jun 20, 2009 at 6:05 PM, Markus Wanner<markus(at)bluegap(dot)ch> wrote:
> Reading the past messages on this topic, I realized that this problem so
> far only affects HPUX. I fear the proposed UDP/semaphores approach might
> have a similar gotcha on at least one of the supported platforms, too.
> Limits of open file descriptors come to mind, for example. Or kernel
> packet filtering rules, as mentioned in pgstat.c.

You're right. The UDP approach at least would cause another dissatisfaction,
as you illustrated.

> If I understand correctly, even Postgres itself suffers from that
> problem on HPUX (even though the consequences aren't dramatic, as
> pointed out by Tom). Plus we are not completely save from syscalls
> returning EINTR due to SA_RESTART not being set for SIGALRM.
>
> So, does it really make sense to take care of this issue as part of the
> sync rep patch?

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.

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.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Ford 2009-06-22 07:21:30 Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1
Previous Message Peter Eisentraut 2009-06-22 07:13:00 Re: Missing Docs for MOVE direction?