Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
> > Hi, I had already read that doc but I can't answer clearly to my >> questions 2,4 and 5. >> > > The answer would seem to depend on what you consider 'a consistency state > position'. Is it possible to be more explicit about what you mean? > >> >> Hi, I meant a position such that, if you

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
> > > 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:

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Alvaro Herrera
Tom DalPozzo wrote: > 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

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
> > Whether any individual tuple in the data files is visible or not depends > not only on the data itself, but also on the commit status of the > transactions that created it (and deleted it, if any). Replaying WAL > also updates the commit status of transactions, so if you're in the > middle of

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Alvaro Herrera
Tom DalPozzo wrote: > 2) I see that a checkpoint position can be right in the middle of a group > of records related to a transaction (in the example, transaction id 10684). > So a checkpoint position is NOT a consistency state point, right? > 4) If I'm right at 2) then, between the checkpoint

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Adrian Klaver
On 01/09/2017 01:10 PM, Tom DalPozzo wrote: Reread your original post and realized you where also asking about transaction consistency and WALs. The thumbnail version is that Postgres writes transactions to the WALs before they are written to the data files on

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
> > Reread your original post and realized you where also asking about >> transaction consistency and WALs. The thumbnail version is that Postgres >> writes transactions to the WALs before they are written to the data files >> on disk. A checkpoint represents a point in the sequence when is is

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Adrian Klaver
On 01/09/2017 06:47 AM, Tom DalPozzo wrote: https://www.postgresql.org/docs/9.5/static/wal-internals.html "After a checkpoint has been made and the log flushed, the checkpoint's position is saved in the

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Adrian Klaver
On 01/09/2017 06:47 AM, Tom DalPozzo wrote: https://www.postgresql.org/docs/9.5/static/wal-internals.html "After a checkpoint has been made and the log flushed, the checkpoint's position is saved in the

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
> > https://www.postgresql.org/docs/9.5/static/wal-internals.html >> > > "After a checkpoint has been made and the log flushed, the checkpoint's > position is saved in the file pg_control. Therefore, at the start of > recovery, the server first reads pg_control and then the checkpoint record; >

Re: [GENERAL] checkpoint clarifications needed

2017-01-09 Thread Adrian Klaver
On 01/09/2017 06:14 AM, Tom DalPozzo wrote: Hi, I need some clarifications about checkpoints. Below here a log from my standby server when started and then some parts of the interested WAL in the master's cluster obtained by pg_xlogdump. Just to have an example to talk on. 1) I see: "LOG:

[GENERAL] checkpoint clarifications needed

2017-01-09 Thread Tom DalPozzo
Hi, I need some clarifications about checkpoints. Below here a log from my standby server when started and then some parts of the interested WAL in the master's cluster obtained by pg_xlogdump. Just to have an example to talk on. 1) I see: "LOG: redo starts at 1/F00A7448" . I was expecting a