Re: Renaming of pg_xlog and pg_clog - Mailing list pgsql-hackers
From | Craig Ringer |
---|---|
Subject | Re: Renaming of pg_xlog and pg_clog |
Date | |
Msg-id | CAMsr+YEtv=PjiRiQBnAd_uu0WNnotG29n0XQLGFporJ_viggMg@mail.gmail.com Whole thread Raw |
In response to | Re: Renaming of pg_xlog and pg_clog (Michael Paquier <michael.paquier@gmail.com>) |
Responses |
Re: Renaming of pg_xlog and pg_clog
|
List | pgsql-hackers |
On 29 August 2016 at 14:30, Michael Paquier <michael.paquier@gmail.com> wrote: > On Mon, Aug 29, 2016 at 2:36 PM, Craig Ringer > <craig.ringer@2ndquadrant.com> wrote: >> I don't care if it comes as part of some greater reorg or not but I'll be >> really annoyed if scope creep lands up killing the original proposal to just >> rename these dirs. I think that a simple rename should be done first. Then >> if some greater reorg is to be done it can be done shortly after. The only >> people that'll upset are folks tracking early 10.0 dev and they'll be aware >> it's coming. > > Okay, so let's do it. Attached are two patches: > - 0001 renames pg_clog to pg_trans. I have let clog.c with its current > name, as well as its structures. That's the mechanical patch, the ony > interesting part being in pg_upgrade. > - 0002 renames pg_xlog to pg_wal. Is there any expectation that a 10.0 pg_basebackup should work on a 9.x server, or fail to work gracefully? There doesn't look to be any version specific handling of the rename there. Otherwise looks good. Doesn't upset 'make check' or the TAP recovery suite. Works: src/test/regress/tmp_check/data $ ls base pg_commit_ts pg_hba.conf pg_logical pg_notify pg_serial pg_stat pg_subtrans pg_trans PG_VERSION postgresql.auto.conf postmaster.opts global pg_dynshmem pg_ident.conf pg_multixact pg_replslot pg_snapshots pg_stat_tmp pg_tblspc pg_twophase pg_wal postgresql.conf It leaves pg_xlogfilename etc with original names as it IMO should. There's no need to break more than we have to and it's still the xlog. The documentation on backup/restore might benefit from a note saying that pg_wal was named pg_xlog prior to 10.0 so tools intended to work on older versions should check PG_VERSION. Though in practice most people who write new tools will target 10.0+ and people maintaining older tools will know, so it's not a big deal. I don't know if the renaming in XLogFileRead of XLOG_FROM_PG_XLOG => XLOG_FROM_PG_WAL is really necessary, but tend to think it's good since that define explicitly refers to the directory name, not transaction logs in general. The patch does not update the translations. I wonder if it's worth doing so to save translators the hassle by sed'ing the following lines: - errhint("The database server will regularly poll the pg_xlog subdirectory to check for files placed there."))); + errhint("The database server will regularly poll the pg_wal subdirectory to check for files placed there."))); - (errmsg("could not open directory \"%s\": %m", "pg_xlog"))); + (errmsg("could not open directory \"%s\": %m", "pg_wal"))); with sed -i 's/\<pg_xlog\>/pg_wal/g' src/backend/po/*.po ? src/backend/access/transam/README should probably have a note about the rename. Looks like changes in pg_upgrade for clog are a bit more than the mechanical changes elsewhere, but seem sensible to me. I haven't yet done a test pg_upgrade run. -- -- Craig Ringer http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Remote DBA, Training &Services
pgsql-hackers by date: