Re: WAL reducing size

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: sql2pg <sekhar(dot)career(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: WAL reducing size
Date: 2017-12-05 02:20:43
Message-ID: CAB7nPqQYxeWok4B1TVEdJ4W0eKyFXQXy_O37CuCEJXPoD70w9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 5, 2017 at 6:12 AM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> sql2pg wrote:
>> how about uncommitted(open transactions) . if a segment has 1 committed and
>> 2 uncommitted transactions then will it keep the segment instead deleting it
>> after checkpoint , since it has 2 uncommitted transactions
>
> There is no connection between transaction commit and checkpoint
> removing WAL files. WAL files are removed after two checkpoints have
> occured, regardless of transactions that might be open. The on-disk
> effects of those transactions that occured before the earlier checkpoint
> are already on disk anyway. The commit record might appear at whatever
> point in the future, and the rows will not become visible to other
> transactions until then, regardless of what happened to the WAL
> segments.

Something that perhaps does not concern you directly, but in Postgres
11 WAL segments get recycled after one completed checkpoint thanks to
commit 4b0d28d.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-12-05 02:25:07 Re: transaction wrap around
Previous Message John R Pierce 2017-12-05 01:52:33 Re: transaction wrap around