pgsql: Call xlc __isync() after, not before, associated compare-and-swa

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Call xlc __isync() after, not before, associated compare-and-swa
Date: 2016-02-20 03:51:57
Message-ID: E1aWyaL-0003X4-RM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Call xlc __isync() after, not before, associated compare-and-swap.

Architecture reference material specifies this order, and s_lock.h
inline assembly agrees. The former order failed to provide mutual
exclusion to lwlock.c and perhaps to other clients. The two xlc
buildfarm members, hornet and mandrill, have failed sixteen times with
duplicate key errors involving pg_class_oid_index or pg_type_oid_index.
Back-patch to 9.5, where commit b64d92f1a5602c55ee8b27a7ac474f03b7aee340
introduced atomics.

Reviewed by Andres Freund and Tom Lane.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5882ca66868e1f6fe287dfb41ebaab0bcb1784b2

Modified Files
--------------
src/bin/pgbench/.gitignore | 1 +
src/bin/pgbench/Makefile | 6 ++++++
src/bin/pgbench/t/001_pgbench.pl | 25 +++++++++++++++++++++++++
src/include/port/atomics/generic-xlc.h | 22 ++++++++++++++--------
src/tools/msvc/clean.bat | 1 +
5 files changed, 47 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2016-02-20 04:02:12 pgsql: doc: Improve CSS style of option element
Previous Message Simon Riggs 2016-02-19 08:36:51 pgsql: Correct StartupSUBTRANS for page wraparound