pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix walsender timeouts when decoding a large transaction
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix walsender timeouts when decoding a large transaction
@ 2017-12-14 16:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-14 16:34 UTC (permalink / raw)
  To: pgsql-committers

Fix walsender timeouts when decoding a large transaction

The logical slots have a fast code path for sending data so as not to
impose too high a per message overhead. The fast path skips checks for
interrupts and timeouts. However, the existing coding failed to consider
the fact that a transaction with a large number of changes may take a
very long time to be processed and sent to the client. This causes the
walsender to ignore interrupts for potentially a long time and more
importantly it will result in the walsender being killed due to
timeout at the end of such a transaction.

This commit changes the fast path to also check for interrupts and only
allows calling the fast path when the last keepalive check happened less
than half the walsender timeout ago. Otherwise the slower code path will
be taken.

Backpatched to 9.4

Petr Jelinek, reviewed by  Kyotaro HORIGUCHI, Yura Sokolov,  Craig
Ringer and Robert Haas.

Discussion: https://postgr.es/m/e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com

Branch
------
master

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

Modified Files
--------------
src/backend/replication/walsender.c | 66 +++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 29 deletions(-)



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

* pgsql: Fix walsender timeouts when decoding a large transaction
@ 2017-12-14 16:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-14 16:34 UTC (permalink / raw)
  To: pgsql-committers

Fix walsender timeouts when decoding a large transaction

The logical slots have a fast code path for sending data so as not to
impose too high a per message overhead. The fast path skips checks for
interrupts and timeouts. However, the existing coding failed to consider
the fact that a transaction with a large number of changes may take a
very long time to be processed and sent to the client. This causes the
walsender to ignore interrupts for potentially a long time and more
importantly it will result in the walsender being killed due to
timeout at the end of such a transaction.

This commit changes the fast path to also check for interrupts and only
allows calling the fast path when the last keepalive check happened less
than half the walsender timeout ago. Otherwise the slower code path will
be taken.

Backpatched to 9.4

Petr Jelinek, reviewed by  Kyotaro HORIGUCHI, Yura Sokolov,  Craig
Ringer and Robert Haas.

Discussion: https://postgr.es/m/e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/87056267eb85268d49670fd7b27fe2d1a9b4de7a

Modified Files
--------------
src/backend/replication/walsender.c | 66 +++++++++++++++++++++----------------
1 file changed, 38 insertions(+), 28 deletions(-)



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

* pgsql: Fix walsender timeouts when decoding a large transaction
@ 2017-12-14 16:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-14 16:34 UTC (permalink / raw)
  To: pgsql-committers

Fix walsender timeouts when decoding a large transaction

The logical slots have a fast code path for sending data so as not to
impose too high a per message overhead. The fast path skips checks for
interrupts and timeouts. However, the existing coding failed to consider
the fact that a transaction with a large number of changes may take a
very long time to be processed and sent to the client. This causes the
walsender to ignore interrupts for potentially a long time and more
importantly it will result in the walsender being killed due to
timeout at the end of such a transaction.

This commit changes the fast path to also check for interrupts and only
allows calling the fast path when the last keepalive check happened less
than half the walsender timeout ago. Otherwise the slower code path will
be taken.

Backpatched to 9.4

Petr Jelinek, reviewed by  Kyotaro HORIGUCHI, Yura Sokolov,  Craig
Ringer and Robert Haas.

Discussion: https://postgr.es/m/e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
src/backend/replication/walsender.c | 66 +++++++++++++++++++++----------------
1 file changed, 38 insertions(+), 28 deletions(-)



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

* pgsql: Fix walsender timeouts when decoding a large transaction
@ 2017-12-14 16:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-14 16:34 UTC (permalink / raw)
  To: pgsql-committers

Fix walsender timeouts when decoding a large transaction

The logical slots have a fast code path for sending data so as not to
impose too high a per message overhead. The fast path skips checks for
interrupts and timeouts. However, the existing coding failed to consider
the fact that a transaction with a large number of changes may take a
very long time to be processed and sent to the client. This causes the
walsender to ignore interrupts for potentially a long time and more
importantly it will result in the walsender being killed due to
timeout at the end of such a transaction.

This commit changes the fast path to also check for interrupts and only
allows calling the fast path when the last keepalive check happened less
than half the walsender timeout ago. Otherwise the slower code path will
be taken.

Backpatched to 9.4

Petr Jelinek, reviewed by  Kyotaro HORIGUCHI, Yura Sokolov,  Craig
Ringer and Robert Haas.

Discussion: https://postgr.es/m/e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/replication/walsender.c | 67 ++++++++++++++++++++-----------------
1 file changed, 37 insertions(+), 30 deletions(-)



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

* pgsql: Fix walsender timeouts when decoding a large transaction
@ 2017-12-14 16:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-14 16:34 UTC (permalink / raw)
  To: pgsql-committers

Fix walsender timeouts when decoding a large transaction

The logical slots have a fast code path for sending data so as not to
impose too high a per message overhead. The fast path skips checks for
interrupts and timeouts. However, the existing coding failed to consider
the fact that a transaction with a large number of changes may take a
very long time to be processed and sent to the client. This causes the
walsender to ignore interrupts for potentially a long time and more
importantly it will result in the walsender being killed due to
timeout at the end of such a transaction.

This commit changes the fast path to also check for interrupts and only
allows calling the fast path when the last keepalive check happened less
than half the walsender timeout ago. Otherwise the slower code path will
be taken.

Backpatched to 9.4

Petr Jelinek, reviewed by  Kyotaro HORIGUCHI, Yura Sokolov,  Craig
Ringer and Robert Haas.

Discussion: https://postgr.es/m/e082a56a-fd95-a250-3bae-0fff93832510@2ndquadrant.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/14c15b1f45c8930fef2a3d69934d3aef69407361

Modified Files
--------------
src/backend/replication/walsender.c | 66 +++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 29 deletions(-)



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


end of thread, other threads:[~2017-12-14 16:34 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 16:34 pgsql: Fix walsender timeouts when decoding a large transaction Andrew Dunstan <andrew@dunslane.net>
2017-12-14 16:34 pgsql: Fix walsender timeouts when decoding a large transaction Andrew Dunstan <andrew@dunslane.net>
2017-12-14 16:34 pgsql: Fix walsender timeouts when decoding a large transaction Andrew Dunstan <andrew@dunslane.net>
2017-12-14 16:34 pgsql: Fix walsender timeouts when decoding a large transaction Andrew Dunstan <andrew@dunslane.net>
2017-12-14 16:34 pgsql: Fix walsender timeouts when decoding a large transaction Andrew Dunstan <andrew@dunslane.net>

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