Re: Broken hint bits (freeze)

From: Sergey Burladyan <eshkinkot(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Dmitriy Sarafannikov <dsarafannikov(at)yandex(dot)ru>, Vladimir Borodin <root(at)simply(dot)name>
Subject: Re: Broken hint bits (freeze)
Date: 2017-06-20 15:42:58
Message-ID: 871sqe7ji5.fsf@seb.koffice.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:

> On Tue, Jun 20, 2017 at 01:10:26PM +0300, Sergey Burladyan wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > > Uh, as I understand it the rsync is going to copy the missing WAL file
> > > > from the new master to the standby, right, and I think pg_controldata
> > > > too, so it should be fine. Have you tested to see if it fails?
> >
> > It need old WAL files from old version for correct restore heap
> > files. New WAL files from new version does not have this information.
> >
> > > The point is that we are checking the "Latest checkpoint location" to
> > > make sure all the WAL was replayed. We are never going to start the
> > > old standby server. Rsync is going to copy the missing/changed files.
> >
> > Only if missing/changed files changed in size, because rsync run with
> > --size-only it does not copy changed files with same size.
>
> I am sorry but I am not understanding. Step 10.b says:
>
> 10.b Make sure the new standby data directories do not exist
>
> Make sure the new standby data directories do not exist or are empty. If
> initdb was run, delete the standby server data directories.
>
> so the _entire_ new data directory is empty before rsync is run, meaning
> that it is an exact copy of the new master.

Yes, new data directory at standby is empty, but you missed old data
directory at standby which is hardlink'ed by rsync into new as at master.

rsync run with _three_ arguments and with --hard-links option:
rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_dir
(remote_dir is parent directory for old and new data at standby)

In this mode rsync compare not only new_pgdata with new empty data
directory at standby, but also compare it with old data directory from
standby and with --size-only it doing this compare only by the file
existence or file size.

If file at standby in old data directory is different from same file at
master, but it have same size, it will be hardlinked into new data
directory at standby and does not copied from master.

--
Sergey Burladyan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2017-06-20 15:51:23 Re: PATCH: Batch/pipelining support for libpq
Previous Message Tom Lane 2017-06-20 15:37:02 Re: initdb initalization failure for collation "ja_JP"