Thread: RCA for MemoryContextAlloc: invalid request size(Known Issue)

RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
yogvinder
Date:
Hi All,

I am having multiple postgresql 7.3(pretty old version now) on rhel4
servers.

I am getting the error MemoryContextAlloc: invalid request size on many of
these servers from time to time.

On crawling through net, I have found that its because of some bad word
value in a variable length field which implies database corruption. A
possible solution to recover database is by deleting the corrupted row and
then continuing till all the bad rows are deleted.

My Queries:
1) What is the root cause? Why database is getting corrupted.

2) Is any newer version or patch can take care of this issue.

3) Any other solution for the same that can update the corrupted data.


Regards,
Yogvinder Singh



--
View this message in context:
http://www.nabble.com/RCA-for-MemoryContextAlloc%3A-invalid-request-size%28Known-Issue%29-tp21331952p21331952.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
Richard Huxton
Date:
yogvinder wrote:
> Hi All,
>
> I am having multiple postgresql 7.3(pretty old version now) on rhel4
> servers.

Which 7.3? Are you aware the community doesn't even officially support
them now?

> I am getting the error MemoryContextAlloc: invalid request size on many of
> these servers from time to time.
>
> On crawling through net, I have found that its because of some bad word
> value in a variable length field which implies database corruption. A
> possible solution to recover database is by deleting the corrupted row and
> then continuing till all the bad rows are deleted.
>
> My Queries:
> 1) What is the root cause? Why database is getting corrupted.

Hardware problems or a bug in the code. If it's happening on a regular
basis it might well be hardware.

> 2) Is any newer version or patch can take care of this issue.

The last download for 7.3 is 7.3.21

http://www.postgresql.org/ftp/source/OLD/

> 3) Any other solution for the same that can update the corrupted data.

If you're using RHEL check with RedHat and see what the latest RPM they
offer is.

--
  Richard Huxton
  Archonet Ltd

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
David Fetter
Date:
On Wed, Jan 07, 2009 at 06:07:02AM -0800, yogvinder wrote:
>
> Hi All,
>
> I am having multiple postgresql 7.3(pretty old version now) on rhel4
> servers.

Not just "pretty old," but past any community support.  You'll need to
build and implement an upgrade strategy along with doing your upgrade.

> I am getting the error MemoryContextAlloc: invalid request size on
> many of these servers from time to time.
>
> On crawling through net, I have found that its because of some bad
> word value in a variable length field which implies database
> corruption. A possible solution to recover database is by deleting
> the corrupted row and then continuing till all the bad rows are
> deleted.
>
> My Queries: 1) What is the root cause? Why database is getting
> corrupted.

The root cause is that whoever was responsible for this cluster failed
to upgrade to a supported version.  Don't Do That Again :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Yogvinder Singh"
Date:
What I am looking for is the version in which this problem has been
resolved.

I can't find it anywhere in the documentation.


-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of David Fetter
Sent: January 07, 2009 8:32 PM
To: yogvinder
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

On Wed, Jan 07, 2009 at 06:07:02AM -0800, yogvinder wrote:
>
> Hi All,
>
> I am having multiple postgresql 7.3(pretty old version now) on rhel4
> servers.

Not just "pretty old," but past any community support.  You'll need to
build and implement an upgrade strategy along with doing your upgrade.

> I am getting the error MemoryContextAlloc: invalid request size on
> many of these servers from time to time.
>
> On crawling through net, I have found that its because of some bad
> word value in a variable length field which implies database
> corruption. A possible solution to recover database is by deleting
> the corrupted row and then continuing till all the bad rows are
> deleted.
>
> My Queries: 1) What is the root cause? Why database is getting
> corrupted.

The root cause is that whoever was responsible for this cluster failed
to upgrade to a supported version.  Don't Do That Again :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Disclaimer :- This e-mail and any attachment may contain confidential, proprietary or legally privileged information.
Ifyou are not the original intended recipient and have erroneously received this message, you are prohibited from
using,copying, altering or disclosing the content of this message. Please delete it immediately and notify the sender.
NewgenSoftware Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising from the use of the
informationtransmitted by this email including damages from virus and further acknowledges that no binding nature of
themessage shall be implied or assumed unless the sender does so expressly with due authority of NSTL.  


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
Stefan Kaltenbrunner
Date:
Yogvinder Singh wrote:
> What I am looking for is the version in which this problem has been
> resolved.
>
> I can't find it anywhere in the documentation.

well there was by far not enough information in your original mail(not
even the exact version you are on) to even verify that this is a data
corruption issue.

it could simply be  a query(or the OS) running out of memory.
As for what changed in the years since 7.3.0 was released simply read up on:

http://www.postgresql.org/docs/current/static/release.html


Stefan

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Yogvinder Singh"
Date:
PostgreSQL Version PostgreSQL Release 7.3.19 installed on RHEL4.

" It could simply be  a query(or the OS) running out of memory." I have
checked for the above situation.  It's not the case.

Moreover I have multiple same configuration servers. The same "select * from
table" query runs on a much larger data set but is failing on a specific
server only. I tried to select one particular row that 2 resulted in the
same error.


Regards,
Yogvinder



-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Stefan
Kaltenbrunner
Sent: January 08, 2009 3:50 PM
To: Yogvinder Singh
Cc: 'David Fetter'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

Yogvinder Singh wrote:
> What I am looking for is the version in which this problem has been
> resolved.
>
> I can't find it anywhere in the documentation.

well there was by far not enough information in your original mail(not
even the exact version you are on) to even verify that this is a data
corruption issue.

it could simply be  a query(or the OS) running out of memory.
As for what changed in the years since 7.3.0 was released simply read up on:

http://www.postgresql.org/docs/current/static/release.html


Stefan

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Disclaimer :- This e-mail and any attachment may contain confidential, proprietary or legally privileged information.
Ifyou are not the original intended recipient and have erroneously received this message, you are prohibited from
using,copying, altering or disclosing the content of this message. Please delete it immediately and notify the sender.
NewgenSoftware Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising from the use of the
informationtransmitted by this email including damages from virus and further acknowledges that no binding nature of
themessage shall be implied or assumed unless the sender does so expressly with due authority of NSTL.  


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Yogvinder Singh"
Date:
Correcting myself:

Here is the version details

template1=# select version();
                                                version

----------------------------------------------------------------------------
---------------------------
 PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3
20041212 (Red Hat 3.4.3-9.EL4)
(1 row)

Regards,
Yogvinder Singh

-----Original Message-----
From: Yogvinder Singh [mailto:yogvinder@newgen.co.in]
Sent: January 08, 2009 4:37 PM
To: 'Stefan Kaltenbrunner'
Cc: 'David Fetter'; 'pgsql-general@postgresql.org'
Subject: RE: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

PostgreSQL Version PostgreSQL Release 7.3.19 installed on RHEL4.

" It could simply be  a query(or the OS) running out of memory." I have
checked for the above situation.  It's not the case.

Moreover I have multiple same configuration servers. The same "select * from
table" query runs on a much larger data set but is failing on a specific
server only. I tried to select one particular row that 2 resulted in the
same error.


Regards,
Yogvinder



-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Stefan
Kaltenbrunner
Sent: January 08, 2009 3:50 PM
To: Yogvinder Singh
Cc: 'David Fetter'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

Yogvinder Singh wrote:
> What I am looking for is the version in which this problem has been
> resolved.
>
> I can't find it anywhere in the documentation.

well there was by far not enough information in your original mail(not
even the exact version you are on) to even verify that this is a data
corruption issue.

it could simply be  a query(or the OS) running out of memory.
As for what changed in the years since 7.3.0 was released simply read up on:

http://www.postgresql.org/docs/current/static/release.html


Stefan

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Disclaimer :- This e-mail and any attachment may contain confidential, proprietary or legally privileged information.
Ifyou are not the original intended recipient and have erroneously received this message, you are prohibited from
using,copying, altering or disclosing the content of this message. Please delete it immediately and notify the sender.
NewgenSoftware Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising from the use of the
informationtransmitted by this email including damages from virus and further acknowledges that no binding nature of
themessage shall be implied or assumed unless the sender does so expressly with due authority of NSTL.  


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Scott Marlowe"
Date:
On Thu, Jan 8, 2009 at 4:10 AM, Yogvinder Singh <yogvinder@newgen.co.in> wrote:
> Correcting myself:
>
> Here is the version details
>
> template1=# select version();
>                                                version
>
> ----------------------------------------------------------------------------
> ---------------------------
>  PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3
> 20041212 (Red Hat 3.4.3-9.EL4)

So why are you running a version missing years upon years of bug
fixes?  Just update to the last 7.3.x first

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Yogvinder Singh"
Date:
That I'll do but that still won't answer the question : What is the reason
for the data corruption leading to " MemoryContextAlloc: invalid request
size"



-----Original Message-----
From: Scott Marlowe [mailto:scott.marlowe@gmail.com]
Sent: January 08, 2009 8:18 PM
To: Yogvinder Singh
Cc: Stefan Kaltenbrunner; pgsql-general@postgresql.org
Subject: Re: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

On Thu, Jan 8, 2009 at 4:10 AM, Yogvinder Singh <yogvinder@newgen.co.in>
wrote:
> Correcting myself:
>
> Here is the version details
>
> template1=# select version();
>                                                version
>
>
----------------------------------------------------------------------------
> ---------------------------
>  PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3
> 20041212 (Red Hat 3.4.3-9.EL4)

So why are you running a version missing years upon years of bug
fixes?  Just update to the last 7.3.x first

Disclaimer :- This e-mail and any attachment may contain confidential, proprietary or legally privileged information.
Ifyou are not the original intended recipient and have erroneously received this message, you are prohibited from
using,copying, altering or disclosing the content of this message. Please delete it immediately and notify the sender.
NewgenSoftware Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising from the use of the
informationtransmitted by this email including damages from virus and further acknowledges that no binding nature of
themessage shall be implied or assumed unless the sender does so expressly with due authority of NSTL.  


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Pavan Deolasee"
Date:
On Fri, Jan 9, 2009 at 2:53 PM, Yogvinder Singh <yogvinder@newgen.co.in> wrote:
> That I'll do but that still won't answer the question : What is the reason
> for the data corruption leading to " MemoryContextAlloc: invalid request
> size"
>

That's because you may read the corrupt data and do further operations
which leads to failure. For example, the tuple length may be corrupted
and you try to copy that tuple to memory. That's when the palloc can
fail with the error.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Yogvinder Singh"
Date:
Pavan,

What is the possible reason for the data corruption?

Regards,
Yogvinder


-----Original Message-----
From: Pavan Deolasee [mailto:pavan.deolasee@gmail.com]
Sent: January 09, 2009 2:59 PM
To: Yogvinder Singh
Cc: Scott Marlowe; Stefan Kaltenbrunner; pgsql-general@postgresql.org
Subject: Re: [GENERAL] RCA for MemoryContextAlloc: invalid request
size(Known Issue)

On Fri, Jan 9, 2009 at 2:53 PM, Yogvinder Singh <yogvinder@newgen.co.in>
wrote:
> That I'll do but that still won't answer the question : What is the reason
> for the data corruption leading to " MemoryContextAlloc: invalid request
> size"
>

That's because you may read the corrupt data and do further operations
which leads to failure. For example, the tuple length may be corrupted
and you try to copy that tuple to memory. That's when the palloc can
fail with the error.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

Disclaimer :- This e-mail and any attachment may contain confidential, proprietary or legally privileged information.
Ifyou are not the original intended recipient and have erroneously received this message, you are prohibited from
using,copying, altering or disclosing the content of this message. Please delete it immediately and notify the sender.
NewgenSoftware Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising from the use of the
informationtransmitted by this email including damages from virus and further acknowledges that no binding nature of
themessage shall be implied or assumed unless the sender does so expressly with due authority of NSTL.  


Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
Richard Huxton
Date:
Yogvinder Singh wrote:
> Pavan,
>
> What is the possible reason for the data corruption?

Yogvinder - you haven't provided any information for people to identify
what is corrupted let alone why it is corrupted. Like I said in my reply
on the 7th - it's either hardware problems or a bug in the code.
Tracking down precisely what happened is going to be a lengthy and
complicated process even assuming you have all the tools in place, good
logging etc. Given that you're running 7.3.2 it's unlikely that that is
the case.

Since you're running 7.3.2 and the last release for 7.3 is 7.3.21 you've
chosen to run without 18 sets of bug-fixes issued over a period of five
years.

Have you read the release-notes for those versions and satisfied
yourself that none of the changes affect you?
  http://www.postgresql.org/docs/8.3/static/release.html

If you are not 100% certain that those changes are useless to you,
follow the advice everyone is giving and upgrade to the 7.3.21 as soon
as is practical.

--
  Richard Huxton
  Archonet Ltd

Re: RCA for MemoryContextAlloc: invalid request size(Known Issue)

From
"Pavan Deolasee"
Date:
On Fri, Jan 9, 2009 at 4:17 PM, Yogvinder Singh <yogvinder@newgen.co.in> wrote:
> Pavan,
>
> What is the possible reason for the data corruption?
>

It could be anything from buggy hardware to bug in the code. As many
have pointed out earlier, you are running a very old release and
missing several bug fixes. If you are willing, you could read the
release notes of those missing releases to check if there was any fix
related to data corruption.

I think the best thing to upgrade to the latest point release as soon
as possible.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com