Re: Make autovacuum sort tables in descending order of xid_age

David Kimura <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.general
Message-ID <CAHnPFjQ-ewHe9kZ40muZ0OP8Y6YQ=tp9sKZQ5J4VmkfrqzOhFQ@mail.gmail.com>
On Tue, Jan 7, 2020 at 12:47 PM David Fetter <[email protected]> wrote:
> Per a suggestion Christophe made, please find attached a patch to
> $Subject:

Curious, what's the benefit of autovacuum handling the oldest tables
first? If there is a related thread with the discussion, I couldn't find
it.

> Apart from carefully fudging with pg_resetwal, and short of running in
> production for a few weeks, what would be some good ways to test this?

Greenplum tests autovacuum using a fault injection framework, which
was once proposed by Asim [1] and a function to consume xids [2].

If that isn't an option, maybe you could acquire a vacuum blocking
lock on a table, for example by creating index on it inside a dangling
transaction. Then after autovacuum worker blocks, in a separate
session you could check that a previously older table is now younger.
Does that suffice?


Thanks,
David

[1] https://www.postgresql.org/message-id/CANXE4TdxdESX1jKw48xet-5GvBFVSq=4cgNeioTQff372KO45A@mail.gmail.com
[2] https://github.com/greenplum-db/gpdb/blob/5feccaae6838e68b1443e46ed39d162613c5ece8/src/test/regress/regress_gp.c#L2003
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.