Making pg_standby compression-friendly

From: "Charles Duffy" <charles(at)dyfis(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Making pg_standby compression-friendly
Date: 2008-10-23 03:10:55
Message-ID: e4ccc24e0810222010p12bae2f4xa3a11cb2bc51bd89@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Howdy, all.

I'm interested in compressing archived WAL segments in an environment
set up for PITR in the interests of reducing both network traffic and
storage requirements. However, pg_standby presently checks file sizes,
requiring that an archive segment be exactly the right size to be
considered valid. The idea of compressing log segments is not new --
the clearxlogtail project in pgfoundry provides a tool to make such
compression more effective, and is explicitly intended for said
purpose -- but as of 8.3.4, pg_standby appears not to support such
environments; I propose adding such support.

To allow pg_standby to operate in an environment where archive
segments are compressed, two behaviors are necessary:

- suppressing the file-size checks. This puts the onus on the user to
create these files via an atomic mechanism, but is necessary to allow
compressed files to be considered.
- allowing a custom restore command to be provided. This permits the
user to specify the mechanism to be used to decompress the segment.
One bikeshed is determining whether the user should pass in a command
suitable for use in a pipeline or a command which accepts input and
output as arguments.

A sample implementation is attached, intended only to kickstart
discussion; I'm not attached to either its implementation or its
proposed command-line syntax.

Thoughts?

Attachment Content-Type Size
pg_standby-pipe.patch text/x-diff 4.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-10-23 03:31:49 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Previous Message ITAGAKI Takahiro 2008-10-23 02:09:43 Re: double-buffering page writes