Re: Temporary tables prevent autovacuum, leading to XID wraparound

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Temporary tables prevent autovacuum, leading to XID wraparound
Date: 2018-02-02 06:27:06
Message-ID: CAD21AoDVrjJZLtoyLTfxd7K63t_VRaJ2L9KaL4u9VHsbM-cAWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 2, 2018 at 12:31 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Jan 31, 2018 at 7:37 PM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>> I think the idea would not be an improvement, but just change the
>> policy. The current launcher's policy is "let's launch a new worker as
>> much as possible on the database that is at risk of wraparound most".
>> The idea I suggested makes the cases mentioned on this thread better
>> while perhaps making other cases worse.
>>
>> To improve while keeping the current policy, we might want to use the
>> first idea I proposed. That is, we don't launch a new worker on a
>> database impending wraparound if the last table of the database is
>> being vacuumed. But it needs to share new information such as what
>> tables exist in each database and which tables already have worker. It
>> might be overkill in order to deal with only such a corner case
>> though.
>
> Something like that might work, but I think it needs more thought.
> Maybe, for each database currently being processed by at least 1
> worker, advertise in shared memory the oldest XID that isn't already
> being vacuumed by some AV worker; when considering which database is
> at greatest risk of wraparound, if that value is available, use it
> instead of the database's datfrozenxid. Then when all tables that
> make that database riskier than some other database already have
> workers, some other database can get a chance.
>

Thank you for suggestion. It sounds more smarter. So it would be more
better if we vacuums database for anti-wraparound in ascending order
of relfrozenxid?

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2018-02-02 06:37:46 RE: Temporary tables prevent autovacuum, leading to XID wraparound
Previous Message Jeff Davis 2018-02-02 06:20:01 Re: JIT compiling with LLVM v9.0