Re: Fetching timeline during recovery

2020-02-11 Thread Jehan-Guillaume de Rorthais
On Fri, 31 Jan 2020 15:12:30 +0900 Michael Paquier wrote: > On Thu, Jan 23, 2020 at 05:54:08PM +0100, Jehan-Guillaume de Rorthais wrote: > > Please find the new version of the patch in attachment. > > To be honest, I find the concept of this patch confusing. > pg_stat_wal_receiver is just a

Re: Fetching timeline during recovery

2020-01-30 Thread Michael Paquier
On Thu, Jan 23, 2020 at 05:54:08PM +0100, Jehan-Guillaume de Rorthais wrote: > Please find the new version of the patch in attachment. To be honest, I find the concept of this patch confusing. pg_stat_wal_receiver is just a one-one mapping with the shared memory state of the WAL receiver itself

Re: Fetching timeline during recovery

2020-01-23 Thread Jehan-Guillaume de Rorthais
On Tue, 07 Jan 2020 15:57:29 +0900 (JST) Kyotaro Horiguchi wrote: > At Mon, 23 Dec 2019 15:38:16 +0100, Jehan-Guillaume de Rorthais > wrote in > > 1. we could decide to remove this filter to expose the data even when no > > wal receiver is active. It's the same behavior than

Re: Fetching timeline during recovery

2020-01-06 Thread Kyotaro Horiguchi
At Fri, 3 Jan 2020 16:11:38 +0100, Jehan-Guillaume de Rorthais wrote in > Hi, > > On Mon, 23 Dec 2019 15:38:16 +0100 > Jehan-Guillaume de Rorthais wrote: > [...] > > My idea would be to return a row from pg_stat_get_wal_receiver() as soon as > > a wal receiver has been replicating during the

Re: Fetching timeline during recovery

2020-01-03 Thread Jehan-Guillaume de Rorthais
Hi, On Mon, 23 Dec 2019 15:38:16 +0100 Jehan-Guillaume de Rorthais wrote: [...] > My idea would be to return a row from pg_stat_get_wal_receiver() as soon as > a wal receiver has been replicating during the uptime of the standby, no > matter if there's one currently working or not. If no wal

Re: Fetching timeline during recovery

2019-12-23 Thread Jehan-Guillaume de Rorthais
On Mon, 23 Dec 2019 12:36:56 +0900 Michael Paquier wrote: > On Fri, Dec 20, 2019 at 11:14:28AM +0100, Jehan-Guillaume de Rorthais wrote: > > Yes, that would be great but sadly, it would introduce a regression on > > various tools relying on them. At least, the one doing "select *" or most > >

Re: Fetching timeline during recovery

2019-12-22 Thread Michael Paquier
On Fri, Dec 20, 2019 at 11:14:28AM +0100, Jehan-Guillaume de Rorthais wrote: > Yes, that would be great but sadly, it would introduce a regression on various > tools relying on them. At least, the one doing "select *" or most > probably "select func()". > > But anyway, adding 5 funcs is not a big

Re: Fetching timeline during recovery

2019-12-20 Thread Jehan-Guillaume de Rorthais
On Fri, 20 Dec 2019 13:41:25 +0900 (JST) Kyotaro Horiguchi wrote: > At Fri, 20 Dec 2019 00:35:19 +0100, Jehan-Guillaume de Rorthais > wrote in > > On Fri, 13 Dec 2019 16:12:55 +0900 > > Michael Paquier wrote: > > The first one; > > > > I mentioned a SRF function which takes an input

Re: Fetching timeline during recovery

2019-12-19 Thread Kyotaro Horiguchi
At Fri, 20 Dec 2019 00:35:19 +0100, Jehan-Guillaume de Rorthais wrote in > On Fri, 13 Dec 2019 16:12:55 +0900 > Michael Paquier wrote: The first one; > > I mentioned a SRF function which takes an input argument, but that > > makes no sense. What I would prefer having is just having one > >

Re: Fetching timeline during recovery

2019-12-19 Thread Jehan-Guillaume de Rorthais
On Fri, 13 Dec 2019 16:12:55 +0900 Michael Paquier wrote: > On Wed, Dec 11, 2019 at 10:45:25AM -0500, Stephen Frost wrote: > > I'm confused- wouldn't the above approach be a function that's returning > > only one row, if you had a bunch of columns and then had NULL values for > > those cases

Re: Fetching timeline during recovery

2019-12-19 Thread Jehan-Guillaume de Rorthais
On Wed, 11 Dec 2019 14:20:02 +0900 Michael Paquier wrote: > On Thu, Sep 26, 2019 at 07:20:46PM +0200, Jehan-Guillaume de Rorthais wrote: > > If this solution is accepted, some other function of the same family might > > be good candidates as well, for the sake of homogeneity: > > > > *

Re: Fetching timeline during recovery

2019-12-12 Thread Michael Paquier
On Wed, Dec 11, 2019 at 10:45:25AM -0500, Stephen Frost wrote: > I'm confused- wouldn't the above approach be a function that's returning > only one row, if you had a bunch of columns and then had NULL values for > those cases that didn't apply..? Or, if you were thinking about the SRF > approach

Re: Fetching timeline during recovery

2019-12-11 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > On Wed, Dec 11, 2019 at 10:16:29AM -0500, Stephen Frost wrote: > > I've not followed this discussion very closely but I agree entirely that > > it's really nice to have the timeline be able to be queried in a more > > timely manner than

Re: Fetching timeline during recovery

2019-12-11 Thread Michael Paquier
On Wed, Dec 11, 2019 at 10:16:29AM -0500, Stephen Frost wrote: > I've not followed this discussion very closely but I agree entirely that > it's really nice to have the timeline be able to be queried in a more > timely manner than asking through pg_control_checkpoint() gives you. > > I'm not sure

Re: Fetching timeline during recovery

2019-12-11 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > I would be actually tempted to do the following: one single SRF > function, say pg_wal_info which takes a text argument in input with > the following values: flush, write, insert, receive, replay. Thinking > more about it that would be

Re: Fetching timeline during recovery

2019-12-10 Thread Michael Paquier
On Thu, Sep 26, 2019 at 07:20:46PM +0200, Jehan-Guillaume de Rorthais wrote: > If this solution is accepted, some other function of the same family might be > good candidates as well, for the sake of homogeneity: > > * pg_current_wal_insert_lsn > * pg_current_wal_flush_lsn > *

Re: Fetching timeline during recovery

2019-09-26 Thread Jehan-Guillaume de Rorthais
On Mon, 9 Sep 2019 19:44:10 +0900 Fujii Masao wrote: > On Sat, Sep 7, 2019 at 12:06 AM Jehan-Guillaume de Rorthais > wrote: > > > > On Wed, 4 Sep 2019 00:32:03 +0900 > > Fujii Masao wrote: > > [...] > Thanks for updating the patch! Thank you for your review! Please find in attachment a new

Re: Fetching timeline during recovery

2019-09-09 Thread Fujii Masao
On Sat, Sep 7, 2019 at 12:06 AM Jehan-Guillaume de Rorthais wrote: > > On Wed, 4 Sep 2019 00:32:03 +0900 > Fujii Masao wrote: > > > On Mon, Jul 29, 2019 at 7:26 PM Jehan-Guillaume de Rorthais > > wrote: > > > > > > On Fri, 26 Jul 2019 18:22:25 +0200 > > > Jehan-Guillaume de Rorthais wrote: > >

Re: Fetching timeline during recovery

2019-09-06 Thread Jehan-Guillaume de Rorthais
On Wed, 4 Sep 2019 00:32:03 +0900 Fujii Masao wrote: > On Mon, Jul 29, 2019 at 7:26 PM Jehan-Guillaume de Rorthais > wrote: > > > > On Fri, 26 Jul 2019 18:22:25 +0200 > > Jehan-Guillaume de Rorthais wrote: > > > > > On Fri, 26 Jul 2019 10:02:58 +0200 > > > Jehan-Guillaume de Rorthais wrote:

Re: Fetching timeline during recovery

2019-09-03 Thread Fujii Masao
On Mon, Jul 29, 2019 at 7:26 PM Jehan-Guillaume de Rorthais wrote: > > On Fri, 26 Jul 2019 18:22:25 +0200 > Jehan-Guillaume de Rorthais wrote: > > > On Fri, 26 Jul 2019 10:02:58 +0200 > > Jehan-Guillaume de Rorthais wrote: > > > > > On Fri, 26 Jul 2019 16:49:53 +0900 (Tokyo Standard Time) > > >

Re: Fetching timeline during recovery

2019-07-29 Thread Jehan-Guillaume de Rorthais
On Fri, 26 Jul 2019 18:22:25 +0200 Jehan-Guillaume de Rorthais wrote: > On Fri, 26 Jul 2019 10:02:58 +0200 > Jehan-Guillaume de Rorthais wrote: > > > On Fri, 26 Jul 2019 16:49:53 +0900 (Tokyo Standard Time) > > Kyotaro Horiguchi wrote: > [...] > > > We have an LSN reporting function each for

Re: Fetching timeline during recovery

2019-07-26 Thread Jehan-Guillaume de Rorthais
On Fri, 26 Jul 2019 10:02:58 +0200 Jehan-Guillaume de Rorthais wrote: > On Fri, 26 Jul 2019 16:49:53 +0900 (Tokyo Standard Time) > Kyotaro Horiguchi wrote: [...] > > We have an LSN reporting function each for several objectives. > > > > pg_current_wal_lsn > > pg_current_wal_insert_lsn > >

Re: Fetching timeline during recovery

2019-07-26 Thread Jehan-Guillaume de Rorthais
On Fri, 26 Jul 2019 16:49:53 +0900 (Tokyo Standard Time) Kyotaro Horiguchi wrote: > Hi. > > At Thu, 25 Jul 2019 19:38:08 +0200, Jehan-Guillaume de Rorthais > wrote in <20190725193808.1648ddc8@firost> > > On Wed, 24 Jul 2019 14:33:27 +0200 > > Jehan-Guillaume de Rorthais wrote: > > > > > On

Re: Fetching timeline during recovery

2019-07-26 Thread Kyotaro Horiguchi
Hi. At Thu, 25 Jul 2019 19:38:08 +0200, Jehan-Guillaume de Rorthais wrote in <20190725193808.1648ddc8@firost> > On Wed, 24 Jul 2019 14:33:27 +0200 > Jehan-Guillaume de Rorthais wrote: > > > On Wed, 24 Jul 2019 09:49:05 +0900 > > Michael Paquier wrote: > > > > > On Tue, Jul 23, 2019 at

Re: Fetching timeline during recovery

2019-07-25 Thread Jehan-Guillaume de Rorthais
Hello, On Wed, 24 Jul 2019 14:33:27 +0200 Jehan-Guillaume de Rorthais wrote: > On Wed, 24 Jul 2019 09:49:05 +0900 > Michael Paquier wrote: > > > On Tue, Jul 23, 2019 at 06:05:18PM +0200, Jehan-Guillaume de Rorthais > > wrote: [...] > > I think that there are arguments for being more

Re: Fetching timeline during recovery

2019-07-24 Thread Jehan-Guillaume de Rorthais
Hello Michael, On Wed, 24 Jul 2019 09:49:05 +0900 Michael Paquier wrote: > On Tue, Jul 23, 2019 at 06:05:18PM +0200, Jehan-Guillaume de Rorthais wrote: > > Please, find in attachment a first trivial patch to support > > pg_walfile_name() and pg_walfile_name_offset() on a standby. > > Previous

Re: Fetching timeline during recovery

2019-07-23 Thread Michael Paquier
On Tue, Jul 23, 2019 at 06:05:18PM +0200, Jehan-Guillaume de Rorthais wrote: > Please, find in attachment a first trivial patch to support pg_walfile_name() > and pg_walfile_name_offset() on a standby. > Previous restriction on this functions seems related to ThisTimeLineID not > being safe on

Re: Fetching timeline during recovery

2019-07-23 Thread Jehan-Guillaume de Rorthais
On Tue, 23 Jul 2019 16:00:29 -0400 David Steele wrote: > On 7/23/19 2:59 PM, Andrey Borodin wrote: > > > >> 23 июля 2019 г., в 21:05, Jehan-Guillaume de Rorthais > >> написал(а): > >> > >> Fetching the timeline from a standby could be useful in various situation. > >> Either for backup tools

Re: Fetching timeline during recovery

2019-07-23 Thread David Steele
On 7/23/19 2:59 PM, Andrey Borodin wrote: > >> 23 июля 2019 г., в 21:05, Jehan-Guillaume de Rorthais >> написал(а): >> >> Fetching the timeline from a standby could be useful in various situation. >> Either for backup tools [1] or failover tools during some kind of election >> process. > That

Re: Fetching timeline during recovery

2019-07-23 Thread Andrey Borodin
> 23 июля 2019 г., в 21:05, Jehan-Guillaume de Rorthais > написал(а): > > Fetching the timeline from a standby could be useful in various situation. > Either for backup tools [1] or failover tools during some kind of election > process. That backup tool is reading timeline from