Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Subject: Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease
Date: 2014-02-15 11:11:03
Message-ID: 20140215111103.GB20973@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-02-15 04:20:17 +0100, Florian Pflug wrote:
> Another idea would be to do as you suggest and only mark the PGPROC pointers
> volatile, but to additionally add a check for queue corruption somewhere. We should
> be able to detect that - if we ever hit this issue, LWLockRelease should find a
> PGPROC while traversing the queue whose lwWaitLink is NULL but which isn't equal to
> lock->tail. If that ever happens, we'd simply PANIC.

My current conclusion is that backporting barriers.h is by far the most
reasonable way to go. The compiler problems have been ironed out by
now...
Arguments against?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-02-15 11:21:14 Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication
Previous Message Hannu Krosing 2014-02-15 11:02:41 Re: Ctrl+C from sh can shut down daemonized PostgreSQL cluster