pg_resetxlog bug?

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_resetxlog bug?
Date: 2009-04-30 15:07:26
Message-ID: 3f0b79eb0904300807y43a96717ued641f6624c2470@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Current pg_resetxlog doesn't remove any archive status files. This
may cause continuous failure of archive command since .ready file
remains even if a corresponding XLOG segment is removed. And,
.done file without XLOG segment cannot be removed by checkpoint,
and would remain forever. These are undesirable behaviors.

I think that pg_resetxlog should remove existing archive status files
of XLOG segments. Here is the patch to do so.

Thought?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
resetxlog_0430.patch text/x-patch 2.3 KB

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_resetxlog bug?
Date: 2009-04-30 21:36:47
Message-ID: 1241127407.4163.122.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Fri, 2009-05-01 at 00:07 +0900, Fujii Masao wrote:

> Current pg_resetxlog doesn't remove any archive status files. This
> may cause continuous failure of archive command since .ready file
> remains even if a corresponding XLOG segment is removed. And,
> .done file without XLOG segment cannot be removed by checkpoint,
> and would remain forever. These are undesirable behaviors.

Agreed

> I think that pg_resetxlog should remove existing archive status files
> of XLOG segments. Here is the patch to do so.

Seems OK.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_resetxlog bug?
Date: 2009-05-03 23:17:09
Message-ID: 4601.1241392629@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> Current pg_resetxlog doesn't remove any archive status files. This
> may cause continuous failure of archive command since .ready file
> remains even if a corresponding XLOG segment is removed. And,
> .done file without XLOG segment cannot be removed by checkpoint,
> and would remain forever. These are undesirable behaviors.

> I think that pg_resetxlog should remove existing archive status files
> of XLOG segments. Here is the patch to do so.

Applied with a trivial fix (the ending value of "path" isn't necessarily
right for a complaint about directory read failure, so use a constant
instead).

I back-patched as far as 8.1. The issue exists in 8.0 too, but the
patch didn't apply immediately to 8.0 because of the above issue.
Given the lack of field complaints and 8.0's rather legacy status,
it didn't seem worth expending extra effort on.

regards, tom lane