Making pg_standby compression-friendly - Mailing list pgsql-hackers

From Charles Duffy
Subject Making pg_standby compression-friendly
Date
Msg-id e4ccc24e0810222010p12bae2f4xa3a11cb2bc51bd89@mail.gmail.com
Whole thread Raw
Responses Re: Making pg_standby compression-friendly
Re: Making pg_standby compression-friendly
Re: Making pg_standby compression-friendly
List 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

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Next
From: Tom Lane
Date:
Subject: Re: psql Feature request \set query