Re: checkpoint clarifications needed

From: Tom DalPozzo <t(dot)dalpozzo(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: checkpoint clarifications needed
Date: 2017-01-09 22:45:41
Message-ID: CAK77FCShMemQgsmbFHgFMrnSXCh-GD1RCwzoi8vSd3x+ie+WrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> > Hi,
> > so let's suppose that the WAL is:
> > LSN 10: start transaction 123
> > LSN 11: update tuple 100
> > checkpoint position here (not a record but just for understanding)
> > LSN 12: update tuple 100
> > LSN 13: update tuple 100
> > LSN 14: checkpoint record ( postion=11)
> > LSN 15: update tuple 100
> > and that the system crashes now, before ending to write all the
> > transaction's recs to the WAL (other updates and commit record missing).
> >
> > At the replay, starting from LSN 12, the entire page we had at LSN 11 is
> > written to the disk, though carrying inconsistent data.
> > Then we can even replay up to the end of WAL but always getting
> > inconsistent data.
> > BUT, you say, as the tuple is not commited in the WAL, only the old
> version
> > of the tuple will be visible? Right?
>
> Yes -- all the updated tuples are invisible because the commit record
> for transaction 123 does not appear in wal. A future VACUUM will remove
> all those tuples. Note that precisely for this reason, the original
> version of the tuple had not been removed yet.
>
> --
> Álvaro Herrera https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

Ok! Now many things are clear to me....
Thank you very much
Pupillo

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom DalPozzo 2017-01-09 22:47:52 Re: checkpoint clarifications needed
Previous Message Alvaro Herrera 2017-01-09 22:31:32 Re: checkpoint clarifications needed