pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Try to ensure that stats collector's receive buffer size is at l
6+ messages / 1 participants
[nested] [flat]

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-16 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-16 19:25 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Since commit 4e37b3e15, buildfarm member frogmouth has been failing
occasionally with symptoms indicating that some expected stats data is
getting dropped.  The reason that that commit changed the behavior seems
probably to be that more data is getting shoved at the collector in a short
span of time.  In current sources, the stats test's first session sends
about 9KB of data while exiting, which is probably the same as what was
sent just before wait_for_stats() in the previous test design.  But now,
the test's second session is starting up concurrently, and it sends another
2KB (presumably reflecting its initial catalog accesses).  Since frogmouth
is running on Windows XP, which reputedly has a default socket receive
buffer size of only 8KB, it is not very surprising if this has put us over
the threshold where the receive buffer can overflow and drop messages.

The same mechanism could very easily explain the intermittent stats test
failures we've been seeing for years, since background processes such
as the bgwriter will sometimes send data concurrently with all this, and
could thus cause occasional buffer overflows.

Hence, insert some code into pgstat_init() to increase the stats socket's
receive buffer size to 100KB if it's less than that.  (On failure, emit a
LOG message, but keep going.)  Modern systems seem to have default sizes
in the range of 100KB-250KB, but older platforms don't.  I couldn't find
any platforms that wouldn't accept 100KB, so in theory this won't cause
any portability problems.

If this is successful at reducing the buildfarm failure rate in HEAD,
we should back-patch it, because it's certain that similar buffer overflows
happen in the field on platforms with small buffer sizes.  Going forward,
there might be an argument for trying to increase the buffer size even
more, but let's take a baby step first.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-30 00:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-30 00:28 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Back-patch of commit 8b0b6303e991079726e83d17401405e94da11564.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/34782a348d0ea8bddc92844d24d9e75a06673ac0

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-30 00:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-30 00:28 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Back-patch of commit 8b0b6303e991079726e83d17401405e94da11564.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/82f8c21e06b3d4370944ffd1ba2005f1c488183f

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-30 00:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-30 00:28 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Back-patch of commit 8b0b6303e991079726e83d17401405e94da11564.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/54676c72c91f3aa22714da49f0cbcc205e3dc5b1

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-30 00:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-30 00:28 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Back-patch of commit 8b0b6303e991079726e83d17401405e94da11564.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4a3bb96ce9e938479ccaf03402b39ea6259d5069

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Try to ensure that stats collector's receive buffer size is at l
@ 2017-05-30 00:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-30 00:28 UTC (permalink / raw)
  To: pgsql-committers

Try to ensure that stats collector's receive buffer size is at least 100KB.

Back-patch of commit 8b0b6303e991079726e83d17401405e94da11564.

Discussion: https://postgr.es/m/22173.1494788088@sss.pgh.pa.us

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/364100e0bf85d2de1fa4078f9a74a4cab8366e25

Modified Files
--------------
src/backend/postmaster/pgstat.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2017-05-30 00:28 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 19:25 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>
2017-05-30 00:28 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>
2017-05-30 00:28 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>
2017-05-30 00:28 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>
2017-05-30 00:28 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>
2017-05-30 00:28 pgsql: Try to ensure that stats collector's receive buffer size is at l Tom Lane <tgl@sss.pgh.pa.us>

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