While doing a rather contrived test of something else, using:
perl -le 'print "create table foo (x serial); drop table foo;"
foreach (1..1e6)'|psql
I noticed starvation of autovacuum launcher process and bloating of catalogs.
Basically the WaitLatch in autovacuum.c line 602 (in head) never returns.
This was introduced by a180776f7a1c4554f214b, "Teach unix_latch.c to
use poll() where available"
When the poll() gets EINTR by SIGUSR1 for the invalidation, it
restarts at the full timeout (60 seconds in this case) with no
accounting for the time already waited.
It does not seem outrageous to me that there would be real-world
conditions in which invalidations would be sent more than once a
minute over prolonged periods, so this total starvation seems like a
bug.
Should gettimeofday be called before and after the poll() and then the
difference deducted from timeout?
Cheers,
Jeff