pg_multixact issues

Lists: pgsql-generalpgsql-hackerspgsql-sql
From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: pg_multixact issues
Date: 2014-09-17 12:16:05
Message-ID: CALSLE1P4knmyFa5BzdeYo7fVnjw-1-TwW9dXTEW-9nJjK4fQMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

Hello,

On one my machine the pg_multixact directory size has grown up to 5 GB and
am not sure how to clean up this directory.

From the storage-file-layout this directory contains multitransaction
status data.
pg_multixactSubdirectory containing multitransaction status data (used for
shared row locks)
It would really help if someone can provide some reading material regarding
pg_multixact? Would this also result in database slowness by any chance?

Are there any tweaking commands related to this directory settings, also
how can I cleanup/truncate this directory without impacting the overall
database.

Looking forward to get some insight here.

Regards...


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-17 13:21:47
Message-ID: 54198AEB.2070508@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 09/17/2014 05:16 AM, Dev Kumkar wrote:
>
> Hello,
>
> On one my machine the pg_multixact directory size has grown up to 5 GB
> and am not sure how to clean up this directory.
>
> From the storage-file-layout this directory contains multitransaction
> status data.
> pg_multixact Subdirectory containing multitransaction status data (used
> for shared row locks)
>
>
> It would really help if someone can provide some reading material
> regarding pg_multixact? Would this also result in database slowness by
> any chance?
>
> Are there any tweaking commands related to this directory settings, also
> how can I cleanup/truncate this directory without impacting the overall
> database.

http://www.postgresql.org/docs/9.3/static/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND

Might also want to take a look at pg_stat_activity to see what queries
maybe hanging up:

http://www.postgresql.org/docs/9.3/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW

>
> Looking forward to get some insight here.
>
> Regards...

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-17 13:23:09
Message-ID: 20140917132308.GC25775@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 2014-09-17 17:46:05 +0530, Dev Kumkar wrote:
> On one my machine the pg_multixact directory size has grown up to 5 GB and
> am not sure how to clean up this directory.

Which version of postgres are you using?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-17 13:50:58
Message-ID: CALSLE1Pywi4SAyvOVHn+FfxTHMF88t4esgPXxwS9etWMzeE0Rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Wed, Sep 17, 2014 at 6:51 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

>
> http://www.postgresql.org/docs/9.3/static/routine-
> vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND
>
> Might also want to take a look at pg_stat_activity to see what queries
> maybe hanging up:
>
>
> http://www.postgresql.org/docs/9.3/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW

Thanks, yes have been looking into pg_stat_activity table and somehow the
standard queries are hanging.
Not sure if this is because the database response has become very slow.

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-17 13:51:43
Message-ID: CALSLE1NT4_R_RdK7d6WnoGxAgZnqW2iNowraGDbMYX-Jk6Ccvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Wed, Sep 17, 2014 at 6:53 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:

> On 2014-09-17 17:46:05 +0530, Dev Kumkar wrote:
> > On one my machine the pg_multixact directory size has grown up to 5 GB
> and
> > am not sure how to clean up this directory.
>
> Which version of postgres are you using?
>
> Greetings,
>
> Andres Freund
>

Postgres 9.3.4 (linux-64-bit)

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-17 14:54:42
Message-ID: CALSLE1PTb3a4yjcZJFruBjoK1seZR_SckQ_GpPSVxUjvOxHfqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Wed, Sep 17, 2014 at 7:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> Thanks, yes have been looking into pg_stat_activity table and somehow the
> standard queries are hanging.
> Not sure if this is because the database response has become very slow.
>

Would having a huge pg_multixact directory have an impact on databse
performance?

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-17 20:36:46
Message-ID: CALSLE1MAgy4QC0-xLju6MBxO6Upp6=84xwAMt2dkfiGbd6pB9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Wed, Sep 17, 2014 at 7:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> On Wed, Sep 17, 2014 at 6:51 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
> wrote:
>
>>
>> http://www.postgresql.org/docs/9.3/static/routine-
>> vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND
>>
>
Looked into these details. Can there be an example explained that will
really help to understand this in practice?

Also one additional information here, the database was restarted various
times. But still the pg_multixact directory size is increasing.
Actually there were multiple updates happening in different processes which
lead to the locking issues and landed up into this situation.

How can I recover the system at this stage and also clean up pg_multixact
gracefully?

Regards...


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-17 21:08:59
Message-ID: 5419F86B.3000403@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 09/17/2014 01:36 PM, Dev Kumkar wrote:
> On Wed, Sep 17, 2014 at 7:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com
> <mailto:devdas(dot)kumkar(at)gmail(dot)com>> wrote:
>
> On Wed, Sep 17, 2014 at 6:51 PM, Adrian Klaver
> <adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
>
> http://www.postgresql.org/__docs/9.3/static/routine-__vacuuming.html#VACUUM-FOR-__MULTIXACT-WRAPAROUND
> <http://www.postgresql.org/docs/9.3/static/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND>
>
>
> Looked into these details. Can there be an example explained that will
> really help to understand this in practice?
>
> Also one additional information here, the database was restarted various
> times. But still the pg_multixact directory size is increasing.
> Actually there were multiple updates happening in different processes
> which lead to the locking issues and landed up into this situation.
>
> How can I recover the system at this stage and also clean up
> pg_multixact gracefully?

Now I am moving into the deep water:) Could the first item under Changes
in the link below apply?:

http://www.postgresql.org/docs/current/static/release-9-3-5.html

>
> Regards...

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-17 21:11:36
Message-ID: 5419F908.2080303@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 09/17/2014 01:36 PM, Dev Kumkar wrote:
> On Wed, Sep 17, 2014 at 7:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com
> <mailto:devdas(dot)kumkar(at)gmail(dot)com>> wrote:
>
> On Wed, Sep 17, 2014 at 6:51 PM, Adrian Klaver
> <adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
>
> http://www.postgresql.org/__docs/9.3/static/routine-__vacuuming.html#VACUUM-FOR-__MULTIXACT-WRAPAROUND
> <http://www.postgresql.org/docs/9.3/static/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND>
>
>
> Looked into these details. Can there be an example explained that will
> really help to understand this in practice?
>
> Also one additional information here, the database was restarted various
> times. But still the pg_multixact directory size is increasing.
> Actually there were multiple updates happening in different processes
> which lead to the locking issues and landed up into this situation.
>
> How can I recover the system at this stage and also clean up
> pg_multixact gracefully?

Aaah, hit enter too soon. Also see the other changes under Changes that
apply to multixact in 9.3.5

>
> Regards...

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-18 09:11:07
Message-ID: CALSLE1NT9c9eYs95Q3=7C5dWkzrrULQTy6bcSkFsP1OKA+AXHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Thu, Sep 18, 2014 at 2:41 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

>
> Aaah, hit enter too soon. Also see the other changes under Changes that
> apply to multixact in 9.3.5

Thanks for sharing same. Found this one interesting "Truncate pg_multixact
during checkpoints, not during VACUUM (Álvaro Herrera)" and also other
changes. But am not sure are you suggesting to move to 9.3.5 ?

Actually looking for some guidelines on truncating pg_multixact at this
situation.

- Do I need to run vaccum manually here and then the pg_multixact can be
truncated?
- Actually looking out for some hints wherein can know the current
pg_multixact/members which are active and which one are stale which can be
truncated? Is there any query to find this information?

pg_class.relminmxid can be referred but should I change the value of
autovacuum_multixact_freeze_max_age which defaults to 400 million
multixacts, setting this value to lower limits would help in cleaning up
pg_multixact?

Regards...


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-18 10:33:38
Message-ID: 20140918103338.GF17265@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 2014-09-18 14:41:07 +0530, Dev Kumkar wrote:
> On Thu, Sep 18, 2014 at 2:41 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
> wrote:
>
> >
> > Aaah, hit enter too soon. Also see the other changes under Changes that
> > apply to multixact in 9.3.5
>
>
> Thanks for sharing same. Found this one interesting "Truncate pg_multixact
> during checkpoints, not during VACUUM (Álvaro Herrera)" and also other
> changes. But am not sure are you suggesting to move to 9.3.5 ?

I don't think that's relevant for you.

Did you upgrade the database using pg_upgrade?

> Actually looking for some guidelines on truncating pg_multixact at this
> situation.
>
> - Do I need to run vaccum manually here and then the pg_multixact can be
> truncated?
> - Actually looking out for some hints wherein can know the current
> pg_multixact/members which are active and which one are stale which can be
> truncated? Is there any query to find this information?
>
> pg_class.relminmxid can be referred but should I change the value of
> autovacuum_multixact_freeze_max_age which defaults to 400 million
> multixacts, setting this value to lower limits would help in cleaning up
> pg_multixact?

Can you show pg_controldata output and the output of 'SELECT oid,
datname, relfrozenxid, age(relfrozenxid), relminmxid FROM pg_database;'?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_multixact issues
Date: 2014-09-18 12:50:59
Message-ID: CALSLE1Mngj=vyA-hdKaB-HWQ=gU_A3vDRE4ddyKwViTRFXmLFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:

> I don't think that's relevant for you.
>
> Did you upgrade the database using pg_upgrade?
>

That's correct! No, there is no upgrade here.

> Can you show pg_controldata output and the output of 'SELECT oid,
> datname, relfrozenxid, age(relfrozenxid), relminmxid FROM pg_database;'?
>

Here are the details:
oid datname datfrozenxid age(datfrozenxid) datminmxid
16384 myDB 1673 10872259 1

Additionally wanted to mention couple more points here:
When I try to run "vacuum full" on this machine then facing following issue:
INFO: vacuuming "myDB.mytable"
ERROR: MultiXactId 3622035 has not been created yet -- apparent
wraparound

No Select statements are working on this table, is the table corrupt?

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] [SQL] pg_multixact issues
Date: 2014-09-18 17:22:57
Message-ID: CALSLE1OmAcaj6BmHu07LWNkRgd=xvoHyqsasTTVquHxXcni-mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Thu, Sep 18, 2014 at 6:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
> wrote:
>
>> I don't think that's relevant for you.
>>
>> Did you upgrade the database using pg_upgrade?
>>
>
> That's correct! No, there is no upgrade here.
>
>
>> Can you show pg_controldata output and the output of 'SELECT oid,
>> datname, relfrozenxid, age(relfrozenxid), relminmxid FROM pg_database;'?
>>
>
> Here are the details:
> oid datname datfrozenxid age(datfrozenxid) datminmxid
> 16384 myDB 1673 10872259 1
>
> Additionally wanted to mention couple more points here:
> When I try to run "vacuum full" on this machine then facing following
> issue:
> INFO: vacuuming "myDB.mytable"
> ERROR: MultiXactId 3622035 has not been created yet -- apparent
> wraparound
>
> No Select statements are working on this table, is the table corrupt?
>

Any inputs/hints/tips here?


From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] [SQL] pg_multixact issues
Date: 2014-09-18 21:47:04
Message-ID: 541B52D8.6000005@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 09/18/2014 10:22 AM, Dev Kumkar wrote:
> On Thu, Sep 18, 2014 at 6:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com
> <mailto:devdas(dot)kumkar(at)gmail(dot)com>> wrote:
>
> On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund
> <andres(at)2ndquadrant(dot)com <mailto:andres(at)2ndquadrant(dot)com>> wrote:
>
> I don't think that's relevant for you.
>
> Did you upgrade the database using pg_upgrade?
>
>
> That's correct! No, there is no upgrade here.

The above sentence is not clear to me.

Did you run pg_upgrade to get the data into the database?

If not, how did the database get populated?

>
> Can you show pg_controldata output and the output of 'SELECT oid,
> datname, relfrozenxid, age(relfrozenxid), relminmxid FROM
> pg_database;'?
>
>
> Here are the details:
> oid datname datfrozenxid age(datfrozenxid) datminmxid
> 16384 myDB 1673 10872259 1
>
> Additionally wanted to mention couple more points here:
> When I try to run "vacuum full" on this machine then facing
> following issue:
> INFO: vacuuming "myDB.mytable"
> ERROR: MultiXactId 3622035 has not been created yet --
> apparent wraparound
>
> No Select statements are working on this table, is the table corrupt?
>
>
> Any inputs/hints/tips here?

Have you run the query from here?:

http://www.postgresql.org/docs/9.3/interactive/release-9-3-5.html

WITH list(file) AS (SELECT * FROM pg_ls_dir('pg_multixact/offsets'))
SELECT EXISTS (SELECT * FROM list WHERE file = '0000') AND
NOT EXISTS (SELECT * FROM list WHERE file = '0001') AND
NOT EXISTS (SELECT * FROM list WHERE file = 'FFFF') AND
EXISTS (SELECT * FROM list WHERE file != '0000')
AS file_0000_removal_required;

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_multixact issues
Date: 2014-09-19 02:37:55
Message-ID: 20140919023755.GS4701@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

Dev Kumkar wrote:
> On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
> wrote:

> > Can you show pg_controldata output and the output of 'SELECT oid,
> > datname, relfrozenxid, age(relfrozenxid), relminmxid FROM pg_database;'?
> >
>
> Here are the details:
> oid datname datfrozenxid age(datfrozenxid) datminmxid
> 16384 myDB 1673 10872259 1

Can you paste the pg_controldata output please?

Also, what files are there in pg_multixact/offsets/ ?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_multixact issues
Date: 2014-09-19 07:33:57
Message-ID: 20140919073357.GA4277@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On 2014-09-18 22:52:57 +0530, Dev Kumkar wrote:
> On Thu, Sep 18, 2014 at 6:20 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:
>
> > On Thu, Sep 18, 2014 at 4:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
> > wrote:
> >
> >> I don't think that's relevant for you.
> >>
> >> Did you upgrade the database using pg_upgrade?
> >>
> >
> > That's correct! No, there is no upgrade here.
> >
> >
> >> Can you show pg_controldata output and the output of 'SELECT oid,
> >> datname, relfrozenxid, age(relfrozenxid), relminmxid FROM pg_database;'?
> >>
> >
> > Here are the details:
> > oid datname datfrozenxid age(datfrozenxid) datminmxid
> > 16384 myDB 1673 10872259 1
> >
> > Additionally wanted to mention couple more points here:
> > When I try to run "vacuum full" on this machine then facing following
> > issue:
> > INFO: vacuuming "myDB.mytable"
> > ERROR: MultiXactId 3622035 has not been created yet -- apparent
> > wraparound
> >
> > No Select statements are working on this table, is the table corrupt?
> >
>
> Any inputs/hints/tips here?

Yes: Learning some patience. You'd given the previous answer two hours
before this one. Nobody is paid to work on this list...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-19 07:51:16
Message-ID: CALSLE1MSyf_68KoAXSq8ayUcCwMGCDcbUBpm63TPm75SzYAdNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Fri, Sep 19, 2014 at 8:07 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> Can you paste the pg_controldata output please?
>

pg_controldata output as follows:

pg_control version number: 937
Catalog version number: 201306121
Database system identifier: 6023658189132429183
Database cluster state: in production
pg_control last modified: Fri Sep 19 12:09:05 2014
Latest checkpoint location: 2D3/5DB461C0
Prior checkpoint location: 2D3/5D08D0D0
Latest checkpoint's REDO location: 2D3/5D68EFE0
Latest checkpoint's REDO WAL file: 00000001000002D30000005D
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/10882952
Latest checkpoint's NextOID: 3443291
Latest checkpoint's NextMultiXactId: 3622064
Latest checkpoint's NextMultiOffset: 4294172074
Latest checkpoint's oldestXID: 1673
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Time of latest checkpoint: Fri Sep 19 12:06:35 2014
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
Current wal_level setting: minimal
Current max_connections setting: 100
Current max_prepared_xacts setting: 0
Current max_locks_per_xact setting: 64
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 131072
WAL block size: 8192
Bytes per WAL segment: 16777216
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0

> Also, what files are there in pg_multixact/offsets/ ?
>
Currently there are about 56 files in pg_multixact/offsets/.

0000 0002 0004 0006 0008 000A 000C 000E 0010 0012 0014 0016
0018 001A 001C 001E 0020 0022 0024 0026 0028 002A 002C 002E
0030 0032 0034 0036
0001 0003 0005 0007 0009 000B 000D 000F 0011 0013 0015 0017
0019 001B 001D 001F 0021 0023 0025 0027 0029 002B 002D 002F
0031 0033 0035 0037

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_multixact issues
Date: 2014-09-19 07:53:42
Message-ID: CALSLE1Pq5Xcz0y7c-C1c05zVo+8B+HnB8iyzRVUASHqO2vyVmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Fri, Sep 19, 2014 at 1:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:

> Yes: Learning some patience. You'd given the previous answer two hours
> before this one. Nobody is paid to work on this list...

Apologies for the delay, was working/troubleshooting same issue and was
away from my emails. :(

Regards...


From: Emanuel Calvo <emanuel(dot)calvo(at)2ndquadrant(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_multixact issues
Date: 2014-09-19 13:44:25
Message-ID: 541C3339.3080708@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql


El 17/09/14 10:51, Dev Kumkar escribió:
> On Wed, Sep 17, 2014 at 6:53 PM, Andres Freund <andres(at)2ndquadrant(dot)com
> <mailto:andres(at)2ndquadrant(dot)com>> wrote:
>
> On 2014-09-17 17:46:05 +0530, Dev Kumkar wrote:
> > On one my machine the pg_multixact directory size has grown up
> to 5 GB and
> > am not sure how to clean up this directory.
>
> Which version of postgres are you using?
>
> Greetings,
>
> Andres Freund
>
>
> Postgres 9.3.4 (linux-64-bit)
>
> Regards...
Could it be related to some fixes on 9.3.5?:

- Fix wraparound handling for pg_multixact/members (Álvaro Herrera)
- Truncate pg_multixact during checkpoints, not during VACUUM (Álvaro
Herrera)

--
--
Emanuel Calvo http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Emanuel Calvo <emanuel(dot)calvo(at)2ndquadrant(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_multixact issues
Date: 2014-09-19 14:09:05
Message-ID: CALSLE1N=j+YACcpGAkKVg2Zz5iEq5KPdqVAOkd8Bc=8U5ezsbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Fri, Sep 19, 2014 at 7:14 PM, Emanuel Calvo <
emanuel(dot)calvo(at)2ndquadrant(dot)com> wrote:

>
> Could it be related to some fixes on 9.3.5?:
>
> - Fix wraparound handling for pg_multixact/members (Álvaro Herrera)
> - Truncate pg_multixact during checkpoints, not during VACUUM (Álvaro
> Herrera)
>

Currently won't be possible to upgrade to 9.3.5.

Anything can be done in 9.3.4 to trucate them - vacuum full?

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_multixact issues
Date: 2014-09-26 08:06:22
Message-ID: CALSLE1Pe22dK8ULkGEQd3X3jOrA32Xs2zkxU2OAaUOTU4z+a0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Fri, Sep 19, 2014 at 1:23 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> Apologies for the delay, was working/troubleshooting same issue and was
> away from my emails. :(
> Regards...
>

Received the database with huge pg_multixact directory of size 21G and
there are ~82,000 files in "pg_multixact/members" and 202 files in
"pg_multixact/offsets" directory.

Did run "vacuum full" on this database and it was successful. However now
am not sure about pg_multixact directory. truncating this directory except
0000 file results into database start up issues, of course this is not
correct way of truncating.
FATAL: could not access status of transaction 13224692

Stumped ! Please provide some comments on how to truncate pg_multixact
files and if there is any impact because of these files on database
performance.

Regards...


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-30 15:10:28
Message-ID: CALSLE1PzxeRd0RAmC20-X01TijiR-aSjxAVjfze6keW_iYMdCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Fri, Sep 26, 2014 at 1:36 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> Received the database with huge pg_multixact directory of size 21G and
> there are ~82,000 files in "pg_multixact/members" and 202 files in
> "pg_multixact/offsets" directory.
>
> Did run "vacuum full" on this database and it was successful. However now
> am not sure about pg_multixact directory. truncating this directory except
> 0000 file results into database start up issues, of course this is not
> correct way of truncating.
> FATAL: could not access status of transaction 13224692
>
> Stumped ! Please provide some comments on how to truncate pg_multixact
> files and if there is any impact because of these files on database
> performance.
>

Facing this issue on couple more machines where pg_multixact is huge and
not being cleaned up. Any suggestions / troubleshooting tips?

Regards...


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-30 15:20:13
Message-ID: 20140930152013.GO5311@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

Dev Kumkar wrote:
> On Fri, Sep 26, 2014 at 1:36 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:
>
> > Received the database with huge pg_multixact directory of size 21G and
> > there are ~82,000 files in "pg_multixact/members" and 202 files in
> > "pg_multixact/offsets" directory.
> >
> > Did run "vacuum full" on this database and it was successful. However now
> > am not sure about pg_multixact directory. truncating this directory except
> > 0000 file results into database start up issues, of course this is not
> > correct way of truncating.
> > FATAL: could not access status of transaction 13224692
> >
> > Stumped ! Please provide some comments on how to truncate pg_multixact
> > files and if there is any impact because of these files on database
> > performance.
> >
>
> Facing this issue on couple more machines where pg_multixact is huge and
> not being cleaned up. Any suggestions / troubleshooting tips?

Did you try decreasing the autovacuum_multixact_freeze_min_age and
autovacuum_multixact_freeze_table_age parameters?

What exact server version are you running?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [SQL] pg_multixact issues
Date: 2014-09-30 19:32:04
Message-ID: CALSLE1P-1B+u5sO-mEjR0yc3SSD_fvGh0ZZ=ZgnGVspaCCjmfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers pgsql-sql

On Tue, Sep 30, 2014 at 8:50 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> Did you try decreasing the autovacuum_multixact_freeze_min_age and
> autovacuum_multixact_freeze_table_age parameters?
>
As per the docs this set anywhere from zero to 1 billion for
vacuum_multixact_freeze_min_age

And zero to 2 billion for vacuum_multixact_freeze_table_age.

Modified this to have value 10 and 15 respectively. Not sure if that's
correct way of setting these parameters?

What exact server version are you running?
>
Am using PostgreSQL 9.3.4 (linux-64-bit)

Regards...