From: Bridget Frey <bridget.frey@redfin.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Brauwerman <michael.brauwerman@redfin.com>
Cc: Peter Geoghegan <peter@2ndquadrant.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6200: standby bad memory allocations on SELECT
Date: Mon, 30 Jan 2012 20:07:10 -0800
Message-ID: <1137480939183049761@unknownmsgid> (raw)
In-Reply-To: <23550.1327978836@sss.pgh.pa.us>
References: <CAHOc93mRXhU0CMko1jLvxwkKz42jTRZ63xRxDATsEw2t5ukOZQ@mail.gmail.com>
<CA+TgmoZ6S5e46xThsHKv6-vV58f==D4_TH_ECB2sQsZRngL+8Q@mail.gmail.com>
<CAHOc93mzK58JO8XJdHHp=6tLRjv45WYY4cxsdkAZYNnpNQ7RjA@mail.gmail.com>
<CA+TgmoYxXZQhEosbnd=NaJ8=6oW-AyLJ+RukFBBQ-xYwq5Lfiw@mail.gmail.com>
<CAHDXJ6jes_Zv1OFo=EZn-HGOrjKoy2uLz3Sg4ShXhb0yMY_-5A@mail.gmail.com>
<CAEYLb_VDqHiysP_wgDsef7CXo7+P3tW3qSa9KR5+bWqpc=kJgg@mail.gmail.com>
<CAHDXJ6j6Oyke3z_eNSqA1O8G+3M359c3r5NjUp25F5sRUmSPDA@mail.gmail.com>
<CA+TgmoYDuD1HOX=uaQ8BXn5WZoM406SV6Cutcsc54LPsbDnTWg@mail.gmail.com>
<CAHOc93kpe7yPM6h0ORoxBnF8mA5YxacepQEYqEOkqzOLs9UesA@mail.gmail.com>
<23550.1327978836@sss.pgh.pa.us>
Hi Tom,
Thanks for the reply, we appreciate you time on this. The alloc error
queries all seem to be selects from a btree primary index. I gave an
example in my initial post from the logins table. Usually for us it
is logins but sometimes we have seen it on a few other tables, and
it's always a btree primary key index, very simple type of select.
The queries have been showing up in the logs which is how we know, but
we could also confirm in the core dump. If the problem is data
corruption, it is transient. We replay the same queries and get no
errors. We also have jobs that run that basically do the same series
of selects every day or hour etc. but it is totally random which ones
cause an error. E.g. If it is corruption it somehow magically fixes
itself. Also we still have not seen any issues on the master, this
seems to be a problem only on hot standby slaves (we have three
slaves). The OP, incidentally, reported the same thing - issue is
only on hot standby slaves, it is transient, and it happens on a
select from a btree primary index.
This also does not seem to be load related. It often happens under
periods of light load for us.
Please let us know if you have any other thoughts on what we should look at...
Sent from my iPhone
On Jan 30, 2012, at 7:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bridget Frey <bridget.frey@redfin.com> writes:
>> The second error is an invalid memory alloc error that we're getting ~2
>> dozen times per day in production. The bt for this alloc error is below.
>
> This trace is consistent with the idea that we're getting a corrupt
> tuple out of a table, although it doesn't entirely preclude the
> possibility that the corrupt value is manufactured inside the backend.
> To get much further you're going to need to look at the specific query
> being executed each time this happens, and see if you can detect any
> pattern. Now that you've got debug symbols straightened out, the
> gdb command "p debug_query_string" should accomplish this. (If that
> does not produce anything that looks like one of your application's
> SQL commands, we'll need to try harder to extract the info.) You could
> probably hack the elog(PANIC) to log that before dying, too, if you'd
> rather not manually gdb each core dump.
>
> regards, tom lane
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: bridget.frey@redfin.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, michael.brauwerman@redfin.com, peter@2ndquadrant.com
Subject: Re: BUG #6200: standby bad memory allocations on SELECT
In-Reply-To: <1137480939183049761@unknownmsgid>
References: <CAHOc93mRXhU0CMko1jLvxwkKz42jTRZ63xRxDATsEw2t5ukOZQ@mail.gmail.com> <CA+TgmoZ6S5e46xThsHKv6-vV58f==D4_TH_ECB2sQsZRngL+8Q@mail.gmail.com> <CAHOc93mzK58JO8XJdHHp=6tLRjv45WYY4cxsdkAZYNnpNQ7RjA@mail.gmail.com> <CA+TgmoYxXZQhEosbnd=NaJ8=6oW-AyLJ+RukFBBQ-xYwq5Lfiw@mail.gmail.com> <CAHDXJ6jes_Zv1OFo=EZn-HGOrjKoy2uLz3Sg4ShXhb0yMY_-5A@mail.gmail.com> <CAEYLb_VDqHiysP_wgDsef7CXo7+P3tW3qSa9KR5+bWqpc=kJgg@mail.gmail.com> <CAHDXJ6j6Oyke3z_eNSqA1O8G+3M359c3r5NjUp25F5sRUmSPDA@mail.gmail.com> <CA+TgmoYDuD1HOX=uaQ8BXn5WZoM406SV6Cutcsc54LPsbDnTWg@mail.gmail.com> <CAHOc93kpe7yPM6h0ORoxBnF8mA5YxacepQEYqEOkqzOLs9UesA@mail.gmail.com> <23550.1327978836@sss.pgh.pa.us> <1137480939183049761@unknownmsgid>
* 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