pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: adrian.klaver@aklaver.com
Cc: kobruleht2@hot.ee
Cc: pgsql-general@postgresql.org
Subject: Re: How to recover from compressed wal archieve in windows
Date: Thu, 21 May 2020 14:58:33 +0900
Message-ID: <20200521055833.GK2355@paquier.xyz> (raw)
In-Reply-To: <20200521.133811.1335593976252095567.horikyota.ntt@gmail.com>
References: <aa6d4399-1b99-5b32-0fa8-67abe195beb3@aklaver.com>
	<20200521012738.GI2355@paquier.xyz>
	<1b0b4e55-8206-903e-89aa-3dc2ef4f46fb@aklaver.com>
	<20200521.133811.1335593976252095567.horikyota.ntt@gmail.com>

On Thu, May 21, 2020 at 01:38:11PM +0900, Kyotaro Horiguchi wrote:
> Difference from decompression by restore_command?
> 
> A WAL (segment) file is filled with multiple WAL records. The "full
> page image", which is described to be compressed by the parameter, is
> a part of WAL record. A WAL file is filled with maybe-compressed WAL
> records and has the same size in the case where wal_compression is on.

Well, to be more precise, one or more full page images may be included
in a single record, and they may, or may actually not, have up to two
level of "compression" applied to them:
- A full page image may be logged without the hole in the middle of
the page, reducing its actually size logged.
- It would be reduced in size further more if wal_compression is
enabled.

So you actually have four possible cases for a full-page image:
- Logged with its full 8kB data, with its hole included.
- Logged without its hole.
- Logged with its 8kB data and its hole, compressed with pglz.
- Logged without its hole, and compressed with pglz.

When a page is logged, we register in the record if the hole of the
logged full-page image is included or not, and if the page is
compressed with pglz or not.  Then WAL replay looks at those flags,
and determines what to do by itself when the page image is needed.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (13+ messages)  latest in thread

Message-ID: <20200521055833.GK2355@paquier.xyz>
Permalink:  ../20200521055833.GK2355@paquier.xyz/
Also on:    postgresql.org/message-id/20200521055833.GK2355@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, horikyota.ntt@gmail.com, adrian.klaver@aklaver.com, kobruleht2@hot.ee
  Subject: Re: How to recover from compressed wal archieve in windows
  In-Reply-To: <20200521055833.GK2355@paquier.xyz>
  References: <aa6d4399-1b99-5b32-0fa8-67abe195beb3@aklaver.com> <20200521012738.GI2355@paquier.xyz> <1b0b4e55-8206-903e-89aa-3dc2ef4f46fb@aklaver.com> <20200521.133811.1335593976252095567.horikyota.ntt@gmail.com> <20200521055833.GK2355@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox