Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

Поиск
Список
Период
Сортировка
От Cynthia Shang
Тема Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal
Дата
Msg-id 8A02B2AA-87A8-421A-877D-D04B3A9679D9@crunchydata.com
обсуждение исходный текст
Ответ на [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal  (Vladimir Rusinov <vrusinov@google.com>)
Ответы Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal  (Vladimir Rusinov <vrusinov@google.com>)
Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
I have never heard of coding standards where naming conventions required a function/variable name match a directory or file name. It seems that would be restrictive. 

I'm not trying to pick a fight, I just think the pros should outweigh the cons when choosing a path forward. In this case I see lots of cons and one partial pro; partial because renaming only user facing functions and documentation will create inconsistency within the Postgres code for all of the following. It sounds as if your minds are already made up, which saddens me but I will say nothing further on the matter.


xlog - logstreamer_param
XLOG_BACKUP_END - pg_control.h
XLOG_BACKUP_LABEL - pg_standby.c
xlog_blcksz - ControlFileData
XLOG_BLCKSZ_K - pg_test_fsync.c
XLOG_BRIN_INIT_PAGE - brin_xlog.h
XLOG_BRIN_INSERT - brin_xlog.h
XLOG_BRIN_OPMASK - brin_xlog.h
XLOG_BRIN_UPDATE - brin_xlog.h
XLOG_CHECKPOINT_ONLINE - pg_control.h
XLOG_CONTROL_FILExlog_internal.h
XLOG_DATApg_standby.c
XLOG_DBASE_CREATE - dbcommands_xlog.h
XLOG_DBASE_DROP - dbcommands_xlog.h
XLOG_END_OF_RECOVERY - pg_control.h
XLOG_FNAME_LEN - xlog_internal.h
XLOG_FPI - pg_control.h
XLOG_FPI_FOR_HINT - pg_control.h
XLOG_FPW_CHANGE - pg_control.h
XLOG_FROM_ANY - xlog.c
XLOG_GIN_CREATE_INDEX - gin_private.h
XLOG_GIN_CREATE_PTREE - gin_private.h
XLOG_GIN_DELETE_LISTPAGE - gin_private.h
XLOG_GIN_DELETE_PAGE - gin_private.h
XLOG_GIN_INSERT - gin_private.h
XLOG_GIN_INSERT_LISTPAGE - gin_private.h
XLOG_GIN_SPLIT - gin_private.h
XLOG_GIN_VACUUM_PAGE - gin_private.h
XLOG_GIST_CREATE_INDEX - gist_private.h
XLOG_GIST_PAGE_SPLIT - gist_private.h
XLOG_GIST_PAGE_UPDATE - gist_private.h
XLOG_HEAP2_CLEAN - heapam_xlog.h
XLOG_HEAP2_CLEANUP_INFO - heapam_xlog.h
XLOG_HEAP2_FREEZE_PAGE - heapam_xlog.h
XLOG_HEAP2_LOCK_UPDATED - heapam_xlog.h
XLOG_HEAP2_MULTI_INSERT - heapam_xlog.h
XLOG_HEAP2_NEW_CID - heapam_xlog.h
XLOG_HEAP2_REWRITE - heapam_xlog.h
XLOG_HEAP2_VISIBLE - heapam_xlog.h
XLOG_HEAP_CONFIRM - heapam_xlog.h
XLOG_HEAP_DELETE - heapam_xlog.h
XLOG_HEAP_HOT_UPDATE - heapam_xlog.h
XLOG_HEAP_INIT_PAGE - heapam_xlog.h
XLOG_HEAP_INPLACE - heapam_xlog.h
XLOG_HEAP_INSERT - heapam_xlog.h
XLOG_HEAP_LOCK - heapam_xlog.h
XLOG_HEAP_OPMASK - heapam_xlog.h
XLOG_HEAP_UPDATE - heapam_xlog.h
XLOG_HISTORY - pg_standby.c
XLOG_INVALIDATIONS - standbydefs.h
XLOG_NEXTOID - pg_control.h
XLOG_NOOP - pg_control.h
xlog_outdesc - xlog.c
XLOG_PAGE_MAGIC - xlog_internal.h
XLOG_PARAMETER_CHANGE - pg_control.h
XLOG_RELMAP_UPDATE - relmapper.h
XLOG_RESTORE_POINT - pg_control.h
XLOG_RUNNING_XACTS - standbydefs.h
xlog_seg_size - ControlFileData
XLOG_SEQ_LOG - sequence.h
XLOG_SMGR_CREATE - storage_xlog.h
XLOG_SMGR_TRUNCATE - storage_xlog.h
XLOG_SPGIST_ADD_LEAF - spgist_private.h
XLOG_SPGIST_ADD_NODE - spgist_private.h
XLOG_SPGIST_CREATE_INDEX - spgist_private.h
XLOG_SPGIST_MOVE_LEAFS - spgist_private.h
XLOG_SPGIST_PICKSPLIT - spgist_private.h
XLOG_SPGIST_SPLIT_TUPLE - spgist_private.h
XLOG_SPGIST_VACUUM_LEAF - spgist_private.h
XLOG_SPGIST_VACUUM_REDIRECT - spgist_private.h
XLOG_SPGIST_VACUUM_ROOT - spgist_private.h
XLOG_STANDBY_LOCK - standbydefs.h
XLOG_SWITCH - pg_control.h
XLOG_TBLSPC_CREATE - tablespace.h
XLOG_TBLSPC_DROP - tablespace.h
XLogCacheBlck - XLogCtlData
XLogCtl - xlog.c
XLOGDIR - xlog_internal.h
XLogDumpCountRecord - pg_xlogdump.c
XLogDumpDisplayRecord - pg_xlogdump.c
XLogDumpDisplayStats - pg_xlogdump.c
XLogDumpReadPage - pg_xlogdump.c
XLogDumpStatsRow - pg_xlogdump.c
XLogDumpXLogRead - pg_xlogdump.c
xlogendptr - pg_basebackup.c
XLogFileClose - xlog.c
XLogFileCopy - xlog.c
XLogFileName - xlog_internal.h
XLogFileNameById - xlog_internal.h
XLogFileRead - xlog.c
XLOGfileslop - xlog.c
xlogfpath - parsexlog.c
XLogFromFileName - xlog_internal.h
xlogid - PageXLogRecPtr
xloginsert_cxt - xloginsert.c
XLogIsNeeded - xlog.h
XLogLongPageHeader - xlog_internal.h
XLogPageHeader - xlog_internal.h
XLogPageHeaderSize - xlog_internal.h
XLogPageRead - xlog.c
XLogPageReadCB - xlogreader.h
xlogreadfd - parsexlog.c
xlogreadsegno - parsexlog.c
XLogRecGetData - xlogreader.h
XLogRecGetDataLen - xlogreader.h
XLogRecGetInfo - xlogreader.h
XLogRecGetOrigin - xlogreader.h
XLogRecGetPrev - xlogreader.h
XLogRecGetRmid - xlogreader.h
XLogRecGetTotalLen - xlogreader.h
XLogRecGetXid - xlogreader.h
XLogRecHasAnyBlockRefs - xlogreader.h
XLogRecHasBlockImage - xlogreader.h
XLogRecHasBlockRef - xlogreader.h
XLogRecordAssemble - xloginsert.c
XLogRecPtr - xlogdefs.h
XLogRecPtrIsInvalid - xlogdefs.h
XLogRedoAction - xlogutils.h
XLogSegmentsPerXLogId - xlog_internal.h
XLogSegNo - xlogdefs.h
XLogSegNoOffsetToRecPtr - xlog_internal.h
XLogSegSize - xlog_internal.h
XLogSendLogical - walsender.c
XLogSendPhysical - walsender.c
XLogSource - xlog.c
xlogVacuumPage - ginvacuum.c
XLogWalRcvFlush - walreceiver.c
XLogWalRcvProcessMsg - walreceiver.c
XLogWalRcvSendHSFeedback - walreceiver.c
XLogWalRcvSendReply - walreceiver.c
XLogWalRcvWrite - walreceiver.c
XLogWrite - xlog.c




On Dec 29, 2016, at 12:07 PM, Stephen Frost <sfrost@snowman.net> wrote:

Cynthia,

* Cynthia Shang (cynthia.shang@crunchydata.com) wrote:
1) I agree with Michael that we should make this change backward compatible. It would help PostgreSQL image if we did not break everyone's code. It costs businesses money to rewrite code (e.g. middle tier software, backup tools, etc), test and redeploy to their customers.

While I agree that we don't want to break client code or to make
backwards incompatible changes without good cause, in this case, it's
definitely a good cause and it makes sense to have things be consistent
and that includes changing these functions.

We make backwards-incompatible changes with each major release, which is
part of why we support older versions of PG for as long as we do- to
give PG users time to make any necessary changes for the new version of
PG.  One could argue that we shouldn't ever make a backwards
incompatible change because it will break an existing user's code and
cost users time and effort to rewrite that code, but the flip side of
that is that the extra code and complexity results in its own
maintenance burdens for the code and the project moving forward.

Generally speaking, we've also found that backwards compatibility
'features' end up having a much longer life than they should.
Ultimately, the best way forward tends to be either make the backwards
incompatible change or don't make the change at all.  We've already
agreed on this particular change, and with good reason, so the way
forward is to make the rest of the changes, not to go half-way or to try
and provide some backwards compatibility complexity.

2) We decided to rename the pg_xlog directory because people were deleting it when disks were getting full thinking it was just unimportant logging data; I get that. I'm a little unclear why we need to change the functions - it would be less painful to our users and less risky if we just left them as is. Could someone please elaborate why this change is necessary? I'm just trying to understand that.

It would be inconsistent to change the directory name without also
changing the documentation, functions, and other user-facing pieces.

Thanks!

Stephen

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal