diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/postmaster/pgstat.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index b5ce2f6cc7..d251fddc0b 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -330,6 +330,16 @@ pgstat_init(void) #define TESTBYTEVAL ((char) 199) /* + * This static assertion verifies that we didn't mess up the calculations + * involved in selecting maximum payload sizes for our UDP messages. + * Because the only consequence of overrunning PGSTAT_MAX_MSG_SIZE would + * be silent performance loss from fragmentation, it seems worth having a + * compile-time cross-check that we didn't. + */ + StaticAssertStmt(sizeof(PgStat_Msg) <= PGSTAT_MAX_MSG_SIZE, + 'maximum stats message size exceeds PGSTAT_MAX_MSG_SIZE'); + + /* * Create the UDP socket for sending and receiving statistic messages */ hints.ai_flags = AI_PASSIVE; |