Move backup-related code to xlogbackup.c/.h - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Move backup-related code to xlogbackup.c/.h
Date
Msg-id CALj2ACU=1+7XB2kq89yY9esn0P-Rr1fEBYAHu1LoTCpEaqWOKQ@mail.gmail.com
Whole thread Raw
Responses Re: Move backup-related code to xlogbackup.c/.h
List pgsql-hackers
Hi,

xlog.c currently has ~9000 LOC, out of which ~700 LOC is backup
related, making the file really unmanageable. The commit
7d708093b7400327658a30d1aa1d5e284d37622c added new files
xlogbackup.c/.h for hosting all backup related code eventually. I
propose to move all the backp related code from xlog.c and xlogfuncs.c
to xlogbackup.c/.h. In doing so, I had to add a few Get/Set functions
for XLogCtl variables so that xlogbackup.c can use them.

I'm attaching a patch set where 0001 and 0002 move backup code from
xlogfuncs.c and xlog.c to xlogbackup.c/.h respectively. The advantage
is that all the core's backup code is in one single file making it
more readable and manageable while reducing the xlog.c's file size.

Thoughts?

Thanks Michael Paquier for suggesting to have new files for backup related code.

[1] https://www.postgresql.org/message-id/CALj2ACX0wjo%2B49hbUmvc_zT1zwdqFOQyhorN0Ox-Rk6v97Nejw%40mail.gmail.com

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Obsolete comment in ExecInsert()
Next
From: Robert Haas
Date:
Subject: Re: DROP OWNED BY is broken on master branch.