Re: WIP: Restricting pg_rewind to data/wal dirs

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Chris Travers <chris(dot)travers(at)adjust(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: Restricting pg_rewind to data/wal dirs
Date: 2017-10-30 09:57:16
Message-ID: CAB7nPqTO3ZzQgsjctoYK+biT9TETpLe5FvbxG26ehdXA_e2x8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 30, 2017 at 9:43 AM, Chris Travers <chris(dot)travers(at)adjust(dot)com> wrote:
> Are there any cases right now where you have features added by extensions that write to directories which are required for a rewind?

In some of the stuff I maintain, I actually have one case now of a
configuration file included with include_if_exists by postgresql.conf
and is expected to be generated by a component that my code doing the
rewind has no direct access on... I can control how pg_rewind kicks
in, but I think that you would actually break silently the current
code, which is scary especially if I don't control the code where
pg_rewind is called when Postgres 11 gets integrated into the product
I am thinking about, and even more scary if there is no way to include
something.

> The problem with an exclude list is that we cannot safely exclude
> configuration files or logs (because these could be named anything), right?

You have the exact same problem with base backups now, and any
configuration files created by extensions are a per-case problem...
The pattern that base backups now use is an exclude list. In the
future I would rather see base backups and pg_rewind using the same
infrastructure for both things:
- pg_rewind should use the replication protocol with BASE_BACKUP.
Having it rely on root access now is crazy.
- BASE_BACKUP should have an option where it is possible to exclude
custom paths.
What you are proposing here would make both diverge more, which is in
my opinion not a good approach.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Travers 2017-10-30 10:15:31 Re: WIP: Restricting pg_rewind to data/wal dirs
Previous Message Nikolay Shaplov 2017-10-30 09:49:56 Re: [PATCH] Move all am-related reloption code into src/backend/access/[am-name] and get rid of relopt_kind for custom AM