Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-17 Thread Jeff Janes
On Sun, Dec 16, 2012 at 8:38 AM, Tomas Vondra wrote: > On 8.12.2012 03:08, Jeff Janes wrote: >> >> It seems to me you need considerable expertise to figure out how to do >> optimal recovery (i.e. losing the least transactions) in this >> situation, and that that expertise cannot be automated. Do

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-16 Thread Tomas Vondra
On 8.12.2012 03:08, Jeff Janes wrote: > On Thu, Dec 6, 2012 at 3:52 PM, Tomas Vondra wrote: >> Hi, >> >> On 6.12.2012 23:45, MauMau wrote: >>> From: "Tom Lane" Well, that's unfortunate, but it's not clear that automatic recovery is possible. The only way out of it would be if an undama

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-07 Thread Jeff Janes
On Thu, Dec 6, 2012 at 3:52 PM, Tomas Vondra wrote: > Hi, > > On 6.12.2012 23:45, MauMau wrote: >> From: "Tom Lane" >>> Well, that's unfortunate, but it's not clear that automatic recovery is >>> possible. The only way out of it would be if an undamaged copy of the >>> segment was in pg_xlog/ ..

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-07 Thread MauMau
Tomas wrote: So why don't you use an archive command that does not create such incomplete files? I mean something like this: archive_command = 'cp %p /arch/%f.tmp && mv /arch/%f.tmp /arch/%f' Until the file is renamed, it's considered 'incomplete'. That is a good idea. This would surely sol

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread Daniel Farina
On Thu, Dec 6, 2012 at 9:33 AM, Tom Lane wrote: > "MauMau" writes: >> I'm using PostgreSQL 9.1.6 on Linux. I encountered a serious problem that >> media recovery failed showing the following message: >> FATAL: archive file "000100800028" has wrong size: 7340032 >> instead of 1677721

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread Tomas Vondra
Hi, On 6.12.2012 23:45, MauMau wrote: > From: "Tom Lane" >> Well, that's unfortunate, but it's not clear that automatic recovery is >> possible. The only way out of it would be if an undamaged copy of the >> segment was in pg_xlog/ ... but if I recall the logic correctly, we'd >> not even be try

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread MauMau
From: "Tom Lane" Well, that's unfortunate, but it's not clear that automatic recovery is possible. The only way out of it would be if an undamaged copy of the segment was in pg_xlog/ ... but if I recall the logic correctly, we'd not even be trying to fetch from the archive if we had a local cop

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread MauMau
From: "Kevin Grittner" If you are attempting a PITR-style recovery and you want to include WAL entries from the partially-copied file, pad a copy of it with NUL bytes to the expected length. I'm afraid This is unacceptably difficult, or almost impossible, for many PG users. How do you do the

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread Tom Lane
"MauMau" writes: > I'm using PostgreSQL 9.1.6 on Linux. I encountered a serious problem that > media recovery failed showing the following message: > FATAL: archive file "000100800028" has wrong size: 7340032 > instead of 16777216 Well, that's unfortunate, but it's not clear that

Re: [HACKERS] Serious problem: media recovery fails after system or PostgreSQL crash

2012-12-06 Thread Kevin Grittner
MauMau wrote: > [Problem] > I'm using PostgreSQL 9.1.6 on Linux. I encountered a serious > problem that media recovery failed showing the following message: > > FATAL: archive file "000100800028" has wrong size: > 7340032 instead of 16777216 > > I'm using normal cp command to archive