Skip site navigation (1) Skip section navigation (2)

Re: after using pg_resetxlog, db lost

From: "Shea,Dan [CIS]" <Dan(dot)Shea(at)ec(dot)gc(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: after using pg_resetxlog, db lost
Date: 2004-06-24 17:17:13
Message-ID: 644D07D3D59D8F408CD01AC2F833D8C62B9218@cisxa.cmc.int.ec.gc.ca (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-performance
Tom, thank you for your help.
I increased 000E to 81920 and the databse is working now.
We are using RHAS 3.0 and it does have /dev/zero.

Dan.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thursday, June 24, 2004 12:34 PM
To: Shea,Dan [CIS]
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] after using pg_resetxlog, db lost 


"Shea,Dan [CIS]" <Dan(dot)Shea(at)ec(dot)gc(dot)ca> writes:
> I determined the largest was 12,293,162 and set it to 
> pg_resetxlog -x 15000000 /var/lib/pgsql/data

Okay, but it looks like you will also need to adjust pg_clog to cover
that transaction ID range.  (I had thought pg_resetxlog would handle
this for you, but it looks like not.)

> Jun 24 15:02:05 murphy postgres[28061]: [11-1] PANIC:  could not access status of transaction 15000030
> Jun 24 15:02:05 murphy postgres[28061]: [11-2] DETAIL:  could not read from file "/var/lib/pgsql/data/pg_clog/000E" at offset 73728: Success

You need to append zeroes (8K at a time) to
/var/lib/pgsql/data/pg_clog/000E until it's longer than 73728 bytes.
I'd use something like 
	dd bs=8k count=1 </dev/zero >>/var/lib/pgsql/data/pg_clog/000E
assuming that your system has /dev/zero.

			regards, tom lane

pgsql-performance by date

Next:From: Mischa SandbergDate: 2004-06-24 21:24:58
Subject: Range query optimization
Previous:From: Tom LaneDate: 2004-06-24 16:33:41
Subject: Re: after using pg_resetxlog, db lost

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group