Re: pg_rewind: Skip log directory for file type check like pg_wal

From: Soumyadeep Chakraborty <soumyadeep2007(at)gmail(dot)com>
To: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_rewind: Skip log directory for file type check like pg_wal
Date: 2023-03-06 18:36:42
Message-ID: CAE-ML+_miDfT62xhz+fEG3r-ffhGyttLUajA=5LVn0pPJG95bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 6, 2023 at 12:28 AM Alexander Kukushkin <cyberdemn(at)gmail(dot)com> wrote:
>
> Hello Soumyadeep,
>
> The problem indeed exists, but IMO the "log" directory case must be handled differently:
> 1. We don't need or I would even say we don't want to sync log files from the new primary, because it destroys the actual logs, which could be very important to figure out what has happened with the old primary

Yes, this can be solved by adding "log" to excludeDirContents. We did
this for GPDB.

> 2. Unlike "pg_wal", the "log" directory is not necessarily located inside PGDATA. The actual value is configured using "log_directory" GUC, which just happened to be "log" by default. And in fact actual values on source and target could be different.

I think we only care about files/dirs inside the datadir. Anything
outside is out of scope for
pg_rewind AFAIU. We can only address the common case here. As mentioned in this
comment:

* XXX: There is no backend function to get a symbolic link's target in
* general, so if the admin has put any custom symbolic links in the data
* directory, they won't be copied correctly.

There is not much we can do about custom configurations.

Regards,
Soumyadeep (VMware)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark (as CFM) 2023-03-06 18:46:54 Re: Commitfest 2023-03 starting tomorrow!
Previous Message Andres Freund 2023-03-06 18:15:11 Re: About default inBufSize (connection read buffer size) in libpq