Re: [HACKERS] Broken hint bits (freeze) - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Broken hint bits (freeze)
Date
Msg-id CAA4eK1KtEDAKbq_40hSYBTgvTf88Jio4Q_DxiEK0dkjjXdg4_g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Broken hint bits (freeze)  (Vladimir Borodin <root@simply.name>)
Responses Re: [HACKERS] Broken hint bits (freeze)
List pgsql-hackers
On Sat, May 27, 2017 at 10:18 PM, Vladimir Borodin <root@simply.name> wrote:
>
> 26 мая 2017 г., в 21:39, Amit Kapila <amit.kapila16@gmail.com> написал(а):
>
>  I think you somehow need
> to ensure before switchover that all the WAL is replicated to ensure
> this is not a setup problem.
>
>
> Well, actually clean shutdown of master with exit code 0 from `pg_ctl stop
> -m fast` guarantees that all WAL has been replicated to standby.
>

I don't see any such guarantee in code or docs.  Can you explain what
makes you think that for 'fast' mode exit code 0 is a guarantee that
all the WAL be replicated?

> But just in
> case we also check that "Latest checkpoint's REDO location" from control
> file on old master after shutdown is less than
> pg_last_xlog_replay_location() on standby to be promoted.
>
> And if something would go wrong in above logic, postgres will not let you
> attach old master as a standby of new master.
>

I think it will be possible to attach old master as a standby of new
master as some new operations on the new master can increase its LSN
position to a value greater than what old master has.  Your statement
will make sense if you ensure that you don't allow any new operation
on the new master till old master has attached to it as standby.

> So it is highly probable not a
> setup problem.
>

Yeah, it is quite possible that your setup is perfectly fine and there
is actually some code bug due to which you are facing the problem,
however, it is better to rule out all the possibilities related to the
wrong setup.



--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Dang Minh Huong
Date:
Subject: Re: [HACKERS] Extra Vietnamese unaccent rules
Next
From: Erik Rijkers
Date:
Subject: Re: [HACKERS] logical replication - still unstable after all thesemonths