pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix assertion failure in snapshot building
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix assertion failure in snapshot building
@ 2023-07-04 15:38 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2023-07-04 15:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in snapshot building

Clear any potential stale next_phase_at value from the snapshot
builder which otherwise may trip an assertion check ensuring
that there is no next_phase_at value.

This can be reproduced by running 80 concurrent sessions like
the below where $c is a loop counter (assumes there has been
1..$c databases created) :

  echo "
    CREATE TABLE replication_example(id SERIAL PRIMARY KEY,
                                     somedata int,
                                     text varchar(120));
    SELECT 'init' FROM
      pg_create_logical_replication_slot('regression_slot_$c',
                                         'test_decoding');
    SELECT data FROM
      pg_logical_slot_get_changes('regression_slot_$c', NULL,
                                  NULL, 'include-xids', '0',
                                  'skip-empty-xacts', '1');
  " | psql -d regress_$c >>psql.log &

Backpatch down to v16.

Bug: #17695
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reported-by: bowenshi <zxwsbg@qq.com>
Discussion: https://postgr.es/m/17695-6be9277c9295985f@postgresql.org
Backpatch-through: v16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/48efb2302bea3b2af8b4bb865edcc70132ee4250

Modified Files
--------------
src/backend/replication/logical/snapbuild.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)



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

* pgsql: Fix assertion failure in snapshot building
@ 2023-07-04 15:38 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2023-07-04 15:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in snapshot building

Clear any potential stale next_phase_at value from the snapshot
builder which otherwise may trip an assertion check ensuring
that there is no next_phase_at value.

This can be reproduced by running 80 concurrent sessions like
the below where $c is a loop counter (assumes there has been
1..$c databases created) :

  echo "
    CREATE TABLE replication_example(id SERIAL PRIMARY KEY,
                                     somedata int,
                                     text varchar(120));
    SELECT 'init' FROM
      pg_create_logical_replication_slot('regression_slot_$c',
                                         'test_decoding');
    SELECT data FROM
      pg_logical_slot_get_changes('regression_slot_$c', NULL,
                                  NULL, 'include-xids', '0',
                                  'skip-empty-xacts', '1');
  " | psql -d regress_$c >>psql.log &

Backpatch down to v16.

Bug: #17695
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reported-by: bowenshi <zxwsbg@qq.com>
Discussion: https://postgr.es/m/17695-6be9277c9295985f@postgresql.org
Backpatch-through: v16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/eb27d3dc88879cb148ae0365394aae0ab84fa1a7

Modified Files
--------------
src/backend/replication/logical/snapbuild.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)



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

* pgsql: Fix assertion failure in snapshot building
@ 2025-04-30 18:47 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2025-04-30 18:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in snapshot building

Clear any potential stale next_phase_at value from the snapshot
builder which otherwise may trip an assertion check ensuring
that there is no next_phase_at value.

This can be reproduced by running 80 concurrent sessions like
the below where $c is a loop counter (assumes there has been
1..$c databases created) :

  echo "
    CREATE TABLE replication_example(id SERIAL PRIMARY KEY,
                                     somedata int,
                                     text varchar(120));
    SELECT 'init' FROM
      pg_create_logical_replication_slot('regression_slot_$c',
                                         'test_decoding');
    SELECT data FROM
      pg_logical_slot_get_changes('regression_slot_$c', NULL,
                                  NULL, 'include-xids', '0',
                                  'skip-empty-xacts', '1');
  " | psql -d regress_$c >>psql.log &

This was originally committed as 48efb23 and backpatched down to
v16, but since then there have been reports of this happening on
v14 and v15 as well so this is a backpatch of 48efb23 down to 14.

Bug: #17695
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reported-by: bowenshi <zxwsbg@qq.com>
Reported-by: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Reported-by: Teja Mupparti
Discussion: https://postgr.es/m/17695-6be9277c9295985f@postgresql.org
Backpatch-through: v14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7be51eb4e169672d2029d955cb776e2252e6b7d3

Modified Files
--------------
src/backend/replication/logical/snapbuild.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)



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

* pgsql: Fix assertion failure in snapshot building
@ 2025-04-30 18:47 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2025-04-30 18:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in snapshot building

Clear any potential stale next_phase_at value from the snapshot
builder which otherwise may trip an assertion check ensuring
that there is no next_phase_at value.

This can be reproduced by running 80 concurrent sessions like
the below where $c is a loop counter (assumes there has been
1..$c databases created) :

  echo "
    CREATE TABLE replication_example(id SERIAL PRIMARY KEY,
                                     somedata int,
                                     text varchar(120));
    SELECT 'init' FROM
      pg_create_logical_replication_slot('regression_slot_$c',
                                         'test_decoding');
    SELECT data FROM
      pg_logical_slot_get_changes('regression_slot_$c', NULL,
                                  NULL, 'include-xids', '0',
                                  'skip-empty-xacts', '1');
  " | psql -d regress_$c >>psql.log &

This was originally committed as 48efb23 and backpatched down to
v16, but since then there have been reports of this happening on
v14 and v15 as well so this is a backpatch of 48efb23 down to 14.

Bug: #17695
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reported-by: bowenshi <zxwsbg@qq.com>
Reported-by: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Reported-by: Teja Mupparti
Discussion: https://postgr.es/m/17695-6be9277c9295985f@postgresql.org
Backpatch-through: v14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0f404c5812471d21c1d006b4e5f354ca216cea22

Modified Files
--------------
src/backend/replication/logical/snapbuild.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2025-04-30 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04 15:38 pgsql: Fix assertion failure in snapshot building Daniel Gustafsson <dgustafsson@postgresql.org>
2023-07-04 15:38 pgsql: Fix assertion failure in snapshot building Daniel Gustafsson <dgustafsson@postgresql.org>
2025-04-30 18:47 pgsql: Fix assertion failure in snapshot building Daniel Gustafsson <dgustafsson@postgresql.org>
2025-04-30 18:47 pgsql: Fix assertion failure in snapshot building Daniel Gustafsson <dgustafsson@postgresql.org>

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