dbTalk Databases Forums  

XID wrap around : recovering datas

comp.databases.postgresql comp.databases.postgresql


Discuss XID wrap around : recovering datas in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rixed@happyleptic.org
 
Posts: n/a

Default XID wrap around : recovering datas - 08-28-2009 , 11:40 AM






Hi !

Well, on an old 7.4 postgres the vacuum failed for some time without
us noticing it, and now some data is hidden because the XID wrapped.

We would like to recover these data, and we plan to do this :

- first, vacuum freeze to freeze all but future XID
- then, artificially advance current XID by executing 1G times
"begin;end;".
- then, vacuum freeze again
- again, advance current XID by 1G and vacuum freeze.

As I understand it, we should then have recovered all rows that were
in future.

What do you think of this plan ?

Also, why am I unable to find a command that freeze _all_ rows which
XID is >=3 ? This would be helpfull in cases like this. But maybe I
misunderstand how XID works ?

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: XID wrap around : recovering datas - 09-04-2009 , 03:30 AM






rixed (AT) happyleptic (DOT) org wrote:
Quote:
Well, on an old 7.4 postgres the vacuum failed for some time without
us noticing it, and now some data is hidden because the XID wrapped.

We would like to recover these data, and we plan to do this :

- first, vacuum freeze to freeze all but future XID
- then, artificially advance current XID by executing 1G times
"begin;end;".
- then, vacuum freeze again
- again, advance current XID by 1G and vacuum freeze.

As I understand it, we should then have recovered all rows that were
in future.

What do you think of this plan ?

Also, why am I unable to find a command that freeze _all_ rows which
XID is >=3 ? This would be helpfull in cases like this. But maybe I
misunderstand how XID works ?
I have no experience with 7.4 or transaction wraparound, but as a
general advice I recommend that you first of all make a file system
backup of the data directory after shutting down the server.

Other than that, I did a quick archive search and came up with this:
http://archives.postgresql.org/pgsql...2/msg01163.php

Maybe a simple VACUUM is enough...

This also looked interesting:
http://archives.postgresql.org/pgsql...2/msg00412.php

Yours,
Laurenz Albe

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.