Refectoring of receivelog.c - Mailing list pgsql-hackers

From Magnus Hagander
Subject Refectoring of receivelog.c
Date
Msg-id CABUevExgEQrkMPsWdrEFy8zqUYNnKWxDJAWcEXSGNf1uurrjmw@mail.gmail.com
Whole thread Raw
Responses Re: Refectoring of receivelog.c
List pgsql-hackers
I was working on adding the tar streaming functionality we talked about at the developer meeting to pg_basebackup, and rapidly ran across the issue that Andres has been complaining about for a while. The code in receivelog.c just passes an insane number of parameters around. Adding or changing even a small thing ends up touching a huge number of places.

Here's an attempt to refactor the code to instead pass around a control structure. I think it's a definite win already now, and we can't just keep adding new functionality on top of the current one.

I'll proceed to work on the actual functionality I was working on to go on top of this separately, but would appreciate a review of this part independently. It's mostly mechanical, but there may definitely be mistakes - or thinkos in the whole idea...

--
Attachment

pgsql-hackers by date:

Previous
From: Christian Ullrich
Date:
Subject: Re: pl/pgSQL, get diagnostics and big data
Next
From: David Rowley
Date:
Subject: Re: Removing Functionally Dependent GROUP BY Columns