pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Reset properly snapshot export state during transaction abort
7+ messages / 1 participants
[nested] [flat]

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/409f9ca4471331be0f77b665ff3a1836a41de5b3

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/506aa1f71a984564332e3bad5ea450d1a22a5576

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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

* pgsql: Reset properly snapshot export state during transaction abort
@ 2021-10-18 02:57 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2021-10-18 02:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reset properly snapshot export state during transaction abort

During a replication slot creation, an ERROR generated in the same
transaction as the one creating a to-be-exported snapshot would have
left the backend in an inconsistent state, as the associated static
export snapshot state was not being reset on transaction abort, but only
on the follow-up command received by the WAL sender that created this
snapshot on replication slot creation.  This would trigger inconsistency
failures if this session tried to export again a snapshot, like during
the creation of a replication slot.

Note that a snapshot export cannot happen in a transaction block, so
there is no need to worry resetting this state for subtransaction
aborts.  Also, this inconsistent state would very unlikely show up to
users.  For example, one case where this could happen is an
out-of-memory error when building the initial snapshot to-be-exported.
Dilip found this problem while poking at a different patch, that caused
an error in this code path for reasons unrelated to HEAD.

Author: Dilip Kumar
Reviewed-by: Michael Paquier, Zhihong Yu
Discussion: https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.com
Backpatch-through: 9.6

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c           |  9 +++++++++
src/backend/replication/logical/snapbuild.c | 20 ++++++++++++++++++--
src/include/replication/snapbuild.h         |  1 +
3 files changed, 28 insertions(+), 2 deletions(-)



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


end of thread, other threads:[~2021-10-18 02:57 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>
2021-10-18 02:57 pgsql: Reset properly snapshot export state during transaction abort Michael Paquier <michael@paquier.xyz>

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