agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: logical decoding: Correctly free speculative insertion 6+ messages / 1 participants [nested] [flat]
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f50c329f538fdd979a849a06f425c8f9c94787a5 Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 20 +++++------ src/test/subscription/t/100_bugs.pl | 45 +++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 11 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bd7b2184390fb7ce4a37709a199990e55b251698 Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 22 ++++++------ src/test/subscription/t/100_bugs.pl | 45 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ac445069002c9e8c91878c2ce04d4e6a12398fc6 Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 22 ++++++------ src/test/subscription/t/100_bugs.pl | 45 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/813b0d8f455d38356a7c643e9c5170a185e2a21d Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 25 +++++++------- src/test/subscription/t/100_bugs.pl | 45 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1add4a41bc317b4efa053ad2f2d3347f94864789 Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 25 +++++++------- src/test/subscription/t/100_bugs.pl | 45 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: logical decoding: Correctly free speculative insertion @ 2026-06-16 16:35 Álvaro Herrera <alvherre@kurilemu.de> 0 siblings, 0 replies; 6+ messages in thread From: Álvaro Herrera @ 2026-06-16 16:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org logical decoding: Correctly free speculative insertion The error path in ReorderBufferProcessTXN was not freeing (reorderbuffer.c's representation of) a speculative insertion record correctly. In assert-enabled builds, this leads to an assertion failure. In production builds, I see no effect; there may be a small transient leak, but in an improbable code path such as this, such a leak is not of any significance. For users running with assertions enabled, the crash is annoying. Fix by having ReorderBufferProcessTXN() free the speculative insert ahead of freeing the rest of the transaction, and no longer try to handle that insert as a separate argument to ReorderBufferResetTXN(). This code came in with commit 7259736a6e5b (14-era). Backpatch all the way back. In branches 14-16, also backpatch the assertion that originally fails in the problem scenario, which was added by dbed2e36625d (originally backpatched to 17), that at the end of ReorderBufferReturnTXN() the in-memory size of the transaction is zero. Author: Vishal Prasanna <vishal.g@zohocorp.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Backpatch-through: 14 Discussion: https://postgr.es/m/19c7623e882.4080fd5426212.311756747309556767@zohocorp.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0939aad564029ff78e1fb9b79bf8b1dd1c0b38d6 Modified Files -------------- src/backend/replication/logical/reorderbuffer.c | 25 +++++++------- src/test/subscription/t/100_bugs.pl | 43 ++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-06-16 16:35 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de> 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de> 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de> 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de> 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de> 2026-06-16 16:35 pgsql: logical decoding: Correctly free speculative insertion Álvaro Herrera <alvherre@kurilemu.de>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox