Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-12-01 Thread Michael Paquier
On Wed, Dec 2, 2015 at 12:57 AM, Teodor Sigaev wrote: > Thank you, committed. Youhou, thanks! I still think that we should have a test case for this patch close to the script I sent on this thread. I'll get into it once the infrastructure patch for recovery regression tests gets in. -- Michael

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-12-01 Thread Teodor Sigaev
Thank you, committed. Alexander Korotkov wrote: On Sat, Nov 28, 2015 at 2:27 PM, Michael Paquier mailto:michael.paqu...@gmail.com>> wrote: On Fri, Nov 27, 2015 at 11:42 PM, Teodor Sigaev mailto:teo...@sigaev.ru>> wrote: > Seems, patch is ready to commit. But it needs some documentation.

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-12-01 Thread Alexander Korotkov
On Sat, Nov 28, 2015 at 2:27 PM, Michael Paquier wrote: > On Fri, Nov 27, 2015 at 11:42 PM, Teodor Sigaev wrote: > > Seems, patch is ready to commit. But it needs some documentation. > > Of what kind? The documentation of pg_rewind is rather explicit on the > subject and looks fine as-is, and th

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-11-28 Thread Michael Paquier
On Fri, Nov 27, 2015 at 11:42 PM, Teodor Sigaev wrote: > Seems, patch is ready to commit. But it needs some documentation. Of what kind? The documentation of pg_rewind is rather explicit on the subject and looks fine as-is, and that's what Alexander and I agreed on upthread. If there is something

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-11-27 Thread Teodor Sigaev
Seems, patch is ready to commit. But it needs some documentation. Alexander Korotkov wrote: On Wed, Sep 30, 2015 at 9:46 AM, Michael Paquier mailto:michael.paqu...@gmail.com>> wrote: On Sat, Sep 19, 2015 at 8:27 AM, Michael Paquier wrote: > On Fri, Sep 18, 2015 at 6:25 PM, Michael Paqui

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-10-14 Thread Michael Paquier
On Wed, Oct 14, 2015 at 6:00 PM, Alexander Korotkov wrote: > On Sat, Sep 19, 2015 at 2:25 AM, Michael Paquier wrote: >> Alexander, what do you think about that? I think that we should be >> able to rewind with for example node 2 as target and node 3 as source, >> and vice-versa as per the example y

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-10-14 Thread Alexander Korotkov
On Wed, Sep 30, 2015 at 9:46 AM, Michael Paquier wrote: > On Sat, Sep 19, 2015 at 8:27 AM, Michael Paquier wrote: > > On Fri, Sep 18, 2015 at 6:25 PM, Michael Paquier wrote: > >> The refactoring of getTimelineHistory as you propose looks like a good > >> idea to me, I tried to remove by myself th

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-10-14 Thread Alexander Korotkov
On Sat, Sep 19, 2015 at 2:25 AM, Michael Paquier wrote: > OK, I see your point and you are right. This additional check allows > pg_rewind to switch one timeline back and make the scan of blocks > begin at the real origin of both timelines. I had in mind the case > where you tried to actually rew

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-29 Thread Michael Paquier
On Sat, Sep 19, 2015 at 8:27 AM, Michael Paquier wrote: > On Fri, Sep 18, 2015 at 6:25 PM, Michael Paquier wrote: >> The refactoring of getTimelineHistory as you propose looks like a good >> idea to me, I tried to remove by myself the difference between source >> and target in copy_fetch.c and frie

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 6:25 PM, Michael Paquier wrote: > The refactoring of getTimelineHistory as you propose looks like a good > idea to me, I tried to remove by myself the difference between source > and target in copy_fetch.c and friends but this gets uglier, > particularly because of datadir_s

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 12:34 PM, Michael Paquier wrote: > On Fri, Sep 18, 2015 at 9:00 AM, Alexander Korotkov wrote: >> BTW, it would be an option to generate system_identifier to each new >> timeline, by analogy of initdb do for the whole WAL. >> Having such system_identifiers we can distinguish

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Wed, Sep 16, 2015 at 9:47 AM, Alexander Korotkov wrote: > On Thu, Sep 10, 2015 at 8:33 AM, Michael Paquier wrote: > OK, I get it. I tried to get rid of code duplication in the attached patch. > There is getTimelineHistory() function which gets control file as argument > and fetches history from

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Michael Paquier
On Fri, Sep 18, 2015 at 9:00 AM, Alexander Korotkov wrote: > BTW, it would be an option to generate system_identifier to each new > timeline, by analogy of initdb do for the whole WAL. > Having such system_identifiers we can distinguish different timeline which > have assigned same ids. > Any thoug

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-18 Thread Alexander Korotkov
On Wed, Sep 16, 2015 at 7:47 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Thu, Sep 10, 2015 at 8:33 AM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> On Wed, Sep 9, 2015 at 7:13 PM, Alexander Korotkov wrote: > > > A also added additional check in findCommonAncestorT

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-16 Thread Alexander Korotkov
On Thu, Sep 10, 2015 at 8:33 AM, Michael Paquier wrote: > On Wed, Sep 9, 2015 at 7:13 PM, Alexander Korotkov wrote: > > On Wed, Sep 9, 2015 at 9:01 AM, Michael Paquier wrote: > >> The code building the target history file is a duplicate of what is done > >> with the source. Perhaps we could refac

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-10 Thread Alvaro Herrera
Michael Paquier wrote: > On Wed, Sep 9, 2015 at 7:13 PM, Alexander Korotkov wrote: > > I was running manual tests like a noob :) When you attached you bash script, > > I've switched to it. > > [product_placement]The patch to improve the recovery test suite > submitted in this CF would have eased

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-09 Thread Michael Paquier
On Wed, Sep 9, 2015 at 7:13 PM, Alexander Korotkov wrote: > On Wed, Sep 9, 2015 at 9:01 AM, Michael Paquier wrote: >> The code building the target history file is a duplicate of what is done >> with the source. Perhaps we could refactor that as a single routine in >> pg_rewind.c? > > > Do you mean

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-09 Thread Alexander Korotkov
On Wed, Sep 9, 2015 at 9:01 AM, Michael Paquier wrote: > > > On Wed, Sep 9, 2015 at 3:27 AM, Alexander Korotkov > wrote: > >> On Tue, Sep 8, 2015 at 10:28 AM, Michael Paquier >> wrote: >> >>> I am planning to do as well a detailed code review rather soon. >>> >> >> Good, thanks. >> > > When test

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-08 Thread Michael Paquier
On Wed, Sep 9, 2015 at 3:27 AM, Alexander Korotkov wrote: > On Tue, Sep 8, 2015 at 10:28 AM, Michael Paquier > wrote: > >> I am planning to do as well a detailed code review rather soon. >> > > Good, thanks. > When testing a bit more complex structures, it occurred to me that we may want as well

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-08 Thread Alexander Korotkov
On Tue, Sep 8, 2015 at 10:28 AM, Michael Paquier wrote: > On Tue, Sep 8, 2015 at 1:14 AM, Alexander Korotkov wrote: > > On Thu, Aug 20, 2015 at 9:57 AM, Michael Paquier wrote: > >> The code above looks correct to me when scanning the WAL history onwards > >> though, which is what is done when ext

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-08 Thread Michael Paquier
On Tue, Sep 8, 2015 at 1:14 AM, Alexander Korotkov wrote: > On Thu, Aug 20, 2015 at 9:57 AM, Michael Paquier wrote: >> The code above looks correct to me when scanning the WAL history onwards >> though, which is what is done when extracting the page map, but not >> backwards when we try to find the

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-09-07 Thread Alexander Korotkov
On Thu, Aug 20, 2015 at 9:57 AM, Michael Paquier wrote: > On Wed, Jul 22, 2015 at 4:28 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> On Wed, Jul 22, 2015 at 8:48 AM, Michael Paquier < >> michael.paqu...@gmail.com> wrote >> >>> On Mon, Jul 20, 2015 at 9:18 PM, Alexander Korotko

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-08-19 Thread Michael Paquier
On Wed, Jul 22, 2015 at 4:28 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Wed, Jul 22, 2015 at 8:48 AM, Michael Paquier < > michael.paqu...@gmail.com> wrote > >> On Mon, Jul 20, 2015 at 9:18 PM, Alexander Korotkov >> wrote: >> > attached patch allows pg_rewind to work when targ

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-07-22 Thread Alexander Korotkov
On Wed, Jul 22, 2015 at 8:48 AM, Michael Paquier wrote: > On Mon, Jul 20, 2015 at 9:18 PM, Alexander Korotkov > wrote: > > attached patch allows pg_rewind to work when target timeline was > switched. > > Actually, this patch fixes TODO from pg_rewind comments. > > > > /* > >* Trace the his

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-07-21 Thread Michael Paquier
On Mon, Jul 20, 2015 at 9:18 PM, Alexander Korotkov wrote: > attached patch allows pg_rewind to work when target timeline was switched. > Actually, this patch fixes TODO from pg_rewind comments. > > /* >* Trace the history backwards, until we hit the target timeline. >* >* TODO: This