Re: pg_receivexlog and replication slots

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, furuyao(at)pm(dot)nttdata(dot)co(dot)jp, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_receivexlog and replication slots
Date: 2014-10-01 14:22:52
Message-ID: 20141001142252.GA7158@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-10-01 11:21:12 -0300, Alvaro Herrera wrote:
> Andres Freund wrote:
>
> > From d667f7a63cd62733d88ec5b7228dfd5d7136b9d7 Mon Sep 17 00:00:00 2001
> > From: Michael Paquier <michael(at)otacoo(dot)com>
> > Date: Mon, 1 Sep 2014 20:48:43 +0900
> > Subject: [PATCH 3/4] Refactoring of pg_basebackup utilities
> >
> > Code duplication is reduced with the introduction of new APIs for each
> > individual replication command:
> > - IDENTIFY_SYSTEM
> > - CREATE_REPLICATION_SLOT
> > - DROP_REPLICATION_SLOT
> > A couple of variables used to identify a timeline ID are changed as well
> > to be more consistent with core code.
> > ---
> > src/bin/pg_basebackup/pg_basebackup.c | 21 +----
> > src/bin/pg_basebackup/pg_receivexlog.c | 38 ++------
> > src/bin/pg_basebackup/pg_recvlogical.c | 116 ++++++------------------
> > src/bin/pg_basebackup/streamutil.c | 159 +++++++++++++++++++++++++++++++++
> > src/bin/pg_basebackup/streamutil.h | 10 +++
> > 5 files changed, 207 insertions(+), 137 deletions(-)
>
> Not objecting to any of this, but isn't it a bit funny that a patch that
> aims to reduce duplication ends up with more lines than there were
> originally?

The reduction is there in combination with a later patch - which needs
most of the code moved to streamutil.c.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-01 14:37:10 Re: Full_page_write is off in backup mode
Previous Message Heikki Linnakangas 2014-10-01 14:22:20 Re: open items for 9.4