pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix and improve pg_atomic_flag fallback implementation.
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix and improve pg_atomic_flag fallback implementation.
@ 2018-04-07 03:07  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2018-04-07 03:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix and improve pg_atomic_flag fallback implementation.

The atomics fallback implementation for pg_atomic_flag was broken,
returning the inverted value from pg_atomic_test_set_flag().  This was
unnoticed because a) atomic flags were unused until recently b) the
test code wasn't run when the fallback implementation was in
use (because it didn't allow to test for some edge cases).

Fix the bug, and improve the fallback so it has the same behaviour as
the non-fallback implementation in the problematic edge cases. That
breaks ABI compatibility in the back branches when fallbacks are in
use, but given they were broken until now...

Author: Andres Freund
Reported-by: Daniel Gustafsson
Discussion:
    https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.se
    https://postgr.es/m/20180406233854.uni2h3mbnveczl32@alap3.anarazel.de
Backpatch: 9.5-, where the atomics abstraction was introduced.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8c3debbbf61892dabd8b6f3f8d55e600a7901f2b

Modified Files
--------------
src/backend/port/atomics.c          | 21 +++++++++++++++++++--
src/include/port/atomics/fallback.h | 13 ++-----------
src/test/regress/regress.c          | 14 --------------
3 files changed, 21 insertions(+), 27 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix and improve pg_atomic_flag fallback implementation.
@ 2018-04-07 03:07  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2018-04-07 03:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix and improve pg_atomic_flag fallback implementation.

The atomics fallback implementation for pg_atomic_flag was broken,
returning the inverted value from pg_atomic_test_set_flag().  This was
unnoticed because a) atomic flags were unused until recently b) the
test code wasn't run when the fallback implementation was in
use (because it didn't allow to test for some edge cases).

Fix the bug, and improve the fallback so it has the same behaviour as
the non-fallback implementation in the problematic edge cases. That
breaks ABI compatibility in the back branches when fallbacks are in
use, but given they were broken until now...

Author: Andres Freund
Reported-by: Daniel Gustafsson
Discussion:
    https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.se
    https://postgr.es/m/20180406233854.uni2h3mbnveczl32@alap3.anarazel.de
Backpatch: 9.5-, where the atomics abstraction was introduced.

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5b7fc7b0375e790542e879cd026ed90f2d0100c7

Modified Files
--------------
src/backend/port/atomics.c          | 21 +++++++++++++++++++--
src/include/port/atomics/fallback.h | 13 ++-----------
src/test/regress/regress.c          | 14 --------------
3 files changed, 21 insertions(+), 27 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix and improve pg_atomic_flag fallback implementation.
@ 2018-04-07 03:07  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2018-04-07 03:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix and improve pg_atomic_flag fallback implementation.

The atomics fallback implementation for pg_atomic_flag was broken,
returning the inverted value from pg_atomic_test_set_flag().  This was
unnoticed because a) atomic flags were unused until recently b) the
test code wasn't run when the fallback implementation was in
use (because it didn't allow to test for some edge cases).

Fix the bug, and improve the fallback so it has the same behaviour as
the non-fallback implementation in the problematic edge cases. That
breaks ABI compatibility in the back branches when fallbacks are in
use, but given they were broken until now...

Author: Andres Freund
Reported-by: Daniel Gustafsson
Discussion:
    https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.se
    https://postgr.es/m/20180406233854.uni2h3mbnveczl32@alap3.anarazel.de
Backpatch: 9.5-, where the atomics abstraction was introduced.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1f3bbe00b7b5fd4f2acd43db1c63d5a0328509c3

Modified Files
--------------
src/backend/port/atomics.c          | 21 +++++++++++++++++++--
src/include/port/atomics/fallback.h | 13 ++-----------
src/test/regress/regress.c          | 14 --------------
3 files changed, 21 insertions(+), 27 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix and improve pg_atomic_flag fallback implementation.
@ 2018-04-07 03:07  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Andres Freund @ 2018-04-07 03:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix and improve pg_atomic_flag fallback implementation.

The atomics fallback implementation for pg_atomic_flag was broken,
returning the inverted value from pg_atomic_test_set_flag().  This was
unnoticed because a) atomic flags were unused until recently b) the
test code wasn't run when the fallback implementation was in
use (because it didn't allow to test for some edge cases).

Fix the bug, and improve the fallback so it has the same behaviour as
the non-fallback implementation in the problematic edge cases. That
breaks ABI compatibility in the back branches when fallbacks are in
use, but given they were broken until now...

Author: Andres Freund
Reported-by: Daniel Gustafsson
Discussion:
    https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.se
    https://postgr.es/m/20180406233854.uni2h3mbnveczl32@alap3.anarazel.de
Backpatch: 9.5-, where the atomics abstraction was introduced.

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/73709f1c1e5860dd9a51ded72634391e9bb73794

Modified Files
--------------
src/backend/port/atomics.c          | 21 +++++++++++++++++++--
src/include/port/atomics/fallback.h | 13 ++-----------
src/test/regress/regress.c          | 14 --------------
3 files changed, 21 insertions(+), 27 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-04-07 03:07 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-07 03:07 pgsql: Fix and improve pg_atomic_flag fallback implementation. Andres Freund <andres@anarazel.de>
2018-04-07 03:07 pgsql: Fix and improve pg_atomic_flag fallback implementation. Andres Freund <andres@anarazel.de>
2018-04-07 03:07 pgsql: Fix and improve pg_atomic_flag fallback implementation. Andres Freund <andres@anarazel.de>
2018-04-07 03:07 pgsql: Fix and improve pg_atomic_flag fallback implementation. Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox