From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: emre@hasegeli.com, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Cc: gurkan.gur@innogames.com
Cc: david.pusch@innogames.com
Cc: patrick.schmidt@innogames.com
Subject: Re: Standby corruption after master is restarted
Date: Sat, 14 Apr 2018 19:38:49 +0200
Message-ID: <ce06163c-58ed-5dda-ea5c-138c86b62132@2ndquadrant.com> (raw)
In-Reply-To: <CAE2gYzwUUW+_o8hSQuUkpgJj=OkerBghuKXUe4ZE12dJWA2vaw@mail.gmail.com>
References: <CAE2gYzzVZNsGn=-E6grO4sVQs04J02zNKQofQEO8gu8=qCFR+Q@mail.gmail.com>
<CAE2gYzwUUW+_o8hSQuUkpgJj=OkerBghuKXUe4ZE12dJWA2vaw@mail.gmail.com>
Hi Emre,
On 03/28/2018 07:50 PM, Emre Hasegeli wrote:
> We experienced this issue again, this time on production. The primary
> instance was in a loop of being killed by Linux OOM-killer and being
> restarted in 1 minute intervals. The corruption only happened on one
> of the two standbys. The primary and the other standby have no
> problems. Only the was killed and restarted, the standbys were not.
> There weren't any unusual settings, "fsync" was not disabled. Here is
> the information I collected.
>
I've been trying to reproduce this by running a master with a couple of
replicas, and randomly restarting the master (while pgbench is running).
But so far no luck, so I guess something else is required to reproduce
the behavior ...
> The logs at the time standby broke:
>
>> 2018-03-28 14:00:30 UTC [3693-67] LOG: invalid resource manager ID 39 at 1DFB/D43BE688
>> 2018-03-28 14:00:30 UTC [25347-1] LOG: started streaming WAL from primary at 1DFB/D4000000 on timeline 5
>> 2018-03-28 14:00:59 UTC [3748-357177] LOG: restartpoint starting: time
>> 2018-03-28 14:01:23 UTC [25347-2] FATAL: could not receive data from WAL stream: SSL SYSCALL error: EOF detected
>> 2018-03-28 14:01:24 UTC [3693-68] FATAL: invalid memory alloc request size 1916035072
>
> And from the next try:
>
>> 2018-03-28 14:02:15 UTC [26808-5] LOG: consistent recovery state reached at 1DFB/D6BDDFF8
>> 2018-03-28 14:02:15 UTC [26808-6] FATAL: invalid memory alloc request size 191603507
>
In the initial report (from August 2018) you shared pg_xlogdump output,
showing that the corrupted WAL record is an FPI_FOR_HINT right after
CHECKPOINT_SHUTDOWN. Was it the same case this time?
BTW which versions are we talking about? I see the initial report
mentioned catversion 201608131, this one mentions 201510051, so I'm
guessing 9.6 and 9.5. Which minor versions?
Is the master under load (accepting writes) before shutdown?
How was it restarted, actually? I see you're mentioning OOM killer, so I
guess "kill -9". What about the first report - was it the same case, or
was it restarted "nicely" using pg_ctl?
Could the replica receive the WAL in some other way - say, from a WAL
archive? What archive/restore commands you use?
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, gurkan.gur@innogames.com, david.pusch@innogames.com, patrick.schmidt@innogames.com
Subject: Re: Standby corruption after master is restarted
In-Reply-To: <ce06163c-58ed-5dda-ea5c-138c86b62132@2ndquadrant.com>
References: <CAE2gYzzVZNsGn=-E6grO4sVQs04J02zNKQofQEO8gu8=qCFR+Q@mail.gmail.com> <CAE2gYzwUUW+_o8hSQuUkpgJj=OkerBghuKXUe4ZE12dJWA2vaw@mail.gmail.com> <ce06163c-58ed-5dda-ea5c-138c86b62132@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox