Re: [PATCH]make pg_rewind to not copy useless WAL files

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: chenhj <chjischj(at)163(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH]make pg_rewind to not copy useless WAL files
Date: 2017-09-27 17:29:29
Message-ID: CAPpHfdsdGS5RokddDQZhCvR6S+tpxGto1Z8+sbxDM99db-4MMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 25, 2017 at 6:26 PM, chenhj <chjischj(at)163(dot)com> wrote:

> On 2017-09-23 01:59:0, "Alexander Korotkov" <a(dot)korotkov(at)postgrespro(dot)ru>
> wrote:
>
> On Fri, Sep 22, 2017 at 7:16 PM, chenhj <chjischj(at)163(dot)com> wrote:
>
>> This is the new pacth with TAP test and use Macro XLOGDIR.
>>
>
> Good. I took a quick look over the patch.
> Why do you need master_query(), standby_query() and run_query() in
> RewindTest.pm?
> You can do just $node_master->safe_psql() and $node_slave->safe_psql()
> instead.
>
>
> Ooh, i did not notice that function.Thank you for your advice!
>

Great. I tried this patch. It applies cleanly, but doesn't compile.

pg_rewind.c:310:36: error: too few arguments provided to function-like
> macro invocation
> XLByteToSeg(divergerec, startsegno);
> ^
> ../../../src/include/access/xlog_internal.h:118:9: note: macro
> 'XLByteToSeg' defined here
> #define XLByteToSeg(xlrp, logSegNo, wal_segsz_bytes) \
> ^
> pg_rewind.c:310:2: error: use of undeclared identifier 'XLByteToSeg'
> XLByteToSeg(divergerec, startsegno);
> ^
> pg_rewind.c:311:89: error: too few arguments provided to function-like
> macro invocation
> XLogFileName(divergence_wal_filename,
> targetHistory[lastcommontliIndex].tli, startsegno);
>
> ^
> ../../../src/include/access/xlog_internal.h:155:9: note: macro
> 'XLogFileName' defined here
> #define XLogFileName(fname, tli, logSegNo, wal_segsz_bytes) \
> ^
> pg_rewind.c:311:2: error: use of undeclared identifier 'XLogFileName'
> XLogFileName(divergence_wal_filename,
> targetHistory[lastcommontliIndex].tli, startsegno);
> ^
> pg_rewind.c:312:34: error: too few arguments provided to function-like
> macro invocation
> XLByteToPrevSeg(endrec, endsegno);
> ^
> ../../../src/include/access/xlog_internal.h:121:9: note: macro
> 'XLByteToPrevSeg' defined here
> #define XLByteToPrevSeg(xlrp, logSegNo, wal_segsz_bytes) \
> ^
> pg_rewind.c:312:2: error: use of undeclared identifier 'XLByteToPrevSeg'
> XLByteToPrevSeg(endrec, endsegno);
> ^
> pg_rewind.c:313:57: error: too few arguments provided to function-like
> macro invocation
> XLogFileName(last_source_wal_filename, endtli, endsegno);
> ^
> ../../../src/include/access/xlog_internal.h:155:9: note: macro
> 'XLogFileName' defined here
> #define XLogFileName(fname, tli, logSegNo, wal_segsz_bytes) \
> ^
> pg_rewind.c:313:2: error: use of undeclared identifier 'XLogFileName'
> XLogFileName(last_source_wal_filename, endtli, endsegno);
> ^
> 8 errors generated.

It appears that your patch conflicts with fc49e24f. Please, rebase it.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2017-09-27 17:38:04 Re: WIP: Separate log file for extension
Previous Message Robert Haas 2017-09-27 17:28:22 Re: Binary search in fmgr_isbuiltin() is a bottleneck.