Re: pg_rewind: Skip log directory for file type check like pg_wal - Mailing list pgsql-hackers

From Soumyadeep Chakraborty
Subject Re: pg_rewind: Skip log directory for file type check like pg_wal
Date
Msg-id CAE-ML+_miDfT62xhz+fEG3r-ffhGyttLUajA=5LVn0pPJG95bg@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind: Skip log directory for file type check like pg_wal  (Alexander Kukushkin <cyberdemn@gmail.com>)
Responses Re: pg_rewind: Skip log directory for file type check like pg_wal  (Alexander Kukushkin <cyberdemn@gmail.com>)
List pgsql-hackers
On Mon, Mar 6, 2023 at 12:28 AM Alexander Kukushkin <cyberdemn@gmail.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
actuallogs, 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
couldbe 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)



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: About default inBufSize (connection read buffer size) in libpq
Next
From: "Gregory Stark (as CFM)"
Date:
Subject: Re: Commitfest 2023-03 starting tomorrow!