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

From Alexander Kukushkin
Subject Re: pg_rewind: Skip log directory for file type check like pg_wal
Date
Msg-id CAFh8B==BRCLgJYXwJT04MPQSYnOEAzXcO3Y0FJEGV6jmbybOdA@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind: Skip log directory for file type check like pg_wal  (Soumyadeep Chakraborty <soumyadeep2007@gmail.com>)
List pgsql-hackers

On Tue, 7 Mar 2023 at 08:52, Soumyadeep Chakraborty <soumyadeep2007@gmail.com> wrote:

> It couldn't be achieved just by introducing a static string "log". The "log_directory" GUC must be examined on both, source and target.

Trouble with doing that is if pg_rewind is run in non-libpq (offline)
mode. Then we would have to parse it out of the conf file(s)?
Is there a standard way of doing that?

pg_rewind is already doing something similar for "restore_command":
/*          
 * Get value of GUC parameter restore_command from the target cluster.
 *  
 * This uses a logic based on "postgres -C" to get the value from the
 * cluster.
 */
static void
getRestoreCommand(const char *argv0)

For the running source cluster one could just use "SHOW log_directory"

Regards,
--
Alexander Kukushkin

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Rework LogicalOutputPluginWriterUpdateProgress
Next
From: Pavel Stehule
Date:
Subject: Re: using memoize in in paralel query decreases performance