AutoVacuum starvation from sinval messages - Mailing list pgsql-hackers

From Jeff Janes
Subject AutoVacuum starvation from sinval messages
Date
Msg-id CAMkU=1w2nsTsqu7nurg+CGPMHmfWpxs837SrK1w4yopm47WSOw@mail.gmail.com
Whole thread Raw
Responses Re: AutoVacuum starvation from sinval messages  (Jeff Janes <jeff.janes@gmail.com>)
Re: AutoVacuum starvation from sinval messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: AutoVacuum starvation from sinval messages  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Proof of concept: auto updatable views [Review of Patch]
Next
From: Tom Lane
Date:
Subject: Re: Proof of concept: auto updatable views [Review of Patch]