Re: Broken hint bits (freeze)

From: Vladimir Borodin <root(at)simply(dot)name>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dmitriy Sarafannikov <dsarafannikov(at)yandex(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Broken hint bits (freeze)
Date: 2017-05-27 16:48:24
Message-ID: 2E86EB5F-50ED-4DE2-B14E-98EF8F62B2F2@simply.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> 26 мая 2017 г., в 21:39, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> написал(а):
>
>> And LSN on replica is greater that LSN on master (838D/C4A0D280 > 8092/6A26DD08)
>> How can this be possible?
>>
>
> Yeah, I think this is quite suspicious. This seems to indicate that
> not all WAL records are replicated before the switchover. What is the
> value of "synchronous_commit" you are using?

synchronous_commit = on.

> 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. 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. So it is highly probable not a setup problem.

--
May the force be with you…
https://simply.name

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-05-27 16:56:09 Re: Broken hint bits (freeze)
Previous Message Erik Rijkers 2017-05-27 16:12:46 Re: logical replication - still unstable after all these months