pgsql: Change internal RelFileNode references to RelFileNumber or RelFi

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Change internal RelFileNode references to RelFileNumber or RelFi
Дата
Msg-id E1o97Ny-001VBl-Ul@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Change internal RelFileNode references to RelFileNumber or RelFileLocator.

We have been using the term RelFileNode to refer to either (1) the
integer that is used to name the sequence of files for a certain relation
within the directory set aside for that tablespace/database combination;
or (2) that value plus the OIDs of the tablespace and database; or
occasionally (3) the whole series of files created for a relation
based on those values. Using the same name for more than one thing is
confusing.

Replace RelFileNode with RelFileNumber when we're talking about just the
single number, i.e. (1) from above, and with RelFileLocator when we're
talking about all the things that are needed to locate a relation's files
on disk, i.e. (2) from above. In the places where we refer to (3) as
a relfilenode, instead refer to "relation storage".

Since there is a ton of SQL code in the world that knows about
pg_class.relfilenode, don't change the name of that column, or of other
SQL-facing things that derive their name from it.

On the other hand, do adjust closely-related internal terminology. For
example, the structure member names dbNode and spcNode appear to be
derived from the fact that the structure itself was called RelFileNode,
so change those to dbOid and spcOid. Likewise, various variables with
names like rnode and relnode get renamed appropriately, according to
how they're being used in context.

Hopefully, this is clearer than before. It is also preparation for
future patches that intend to widen the relfilenumber fields from its
current width of 32 bits. Variables that store a relfilenumber are now
declared as type RelFileNumber rather than type Oid; right now, these
are the same, but that can now more easily be changed.

Dilip Kumar, per an idea from me. Reviewed also by Andres Freund.
I fixed some whitespace issues, changed a couple of words in a
comment, and made one other minor correction.

Discussion: http://postgr.es/m/CA+TgmoamOtXbVAQf9hWFzonUo6bhhjS6toZQd7HZ-pmojtAmag@mail.gmail.com
Discussion: http://postgr.es/m/CA+Tgmobp7+7kmi4gkq7Y+4AM9fTvL+O1oQ4-5gFTT+6Ng-dQ=g@mail.gmail.com
Discussion: http://postgr.es/m/CAFiTN-vTe79M8uDH1yprOU64MNFE+R3ODRuA+JWf27JbhY4hJw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b0a55e43299c4ea2a9a8c757f9c26352407d0ccc

Modified Files
--------------
contrib/bloom/blinsert.c                           |   2 +-
contrib/oid2name/oid2name.c                        |  29 +-
contrib/pg_buffercache/pg_buffercache_pages.c      |  10 +-
contrib/pg_prewarm/autoprewarm.c                   |  26 +-
contrib/pg_visibility/pg_visibility.c              |   2 +-
src/backend/access/common/syncscan.c               |  29 +-
src/backend/access/gin/ginbtree.c                  |   2 +-
src/backend/access/gin/ginfast.c                   |   2 +-
src/backend/access/gin/ginutil.c                   |   2 +-
src/backend/access/gin/ginxlog.c                   |   6 +-
src/backend/access/gist/gistbuild.c                |   4 +-
src/backend/access/gist/gistxlog.c                 |  11 +-
src/backend/access/hash/hash_xlog.c                |   6 +-
src/backend/access/hash/hashpage.c                 |   4 +-
src/backend/access/heap/heapam.c                   |  78 +++---
src/backend/access/heap/heapam_handler.c           |  26 +-
src/backend/access/heap/rewriteheap.c              |  10 +-
src/backend/access/heap/visibilitymap.c            |   4 +-
src/backend/access/nbtree/nbtpage.c                |   2 +-
src/backend/access/nbtree/nbtree.c                 |   2 +-
src/backend/access/nbtree/nbtsort.c                |   2 +-
src/backend/access/nbtree/nbtxlog.c                |   8 +-
src/backend/access/rmgrdesc/genericdesc.c          |   2 +-
src/backend/access/rmgrdesc/gindesc.c              |   2 +-
src/backend/access/rmgrdesc/gistdesc.c             |   6 +-
src/backend/access/rmgrdesc/heapdesc.c             |   6 +-
src/backend/access/rmgrdesc/nbtdesc.c              |   4 +-
src/backend/access/rmgrdesc/seqdesc.c              |   4 +-
src/backend/access/rmgrdesc/smgrdesc.c             |   4 +-
src/backend/access/rmgrdesc/xactdesc.c             |  44 +--
src/backend/access/rmgrdesc/xlogdesc.c             |  10 +-
src/backend/access/spgist/spginsert.c              |   6 +-
src/backend/access/spgist/spgxlog.c                |   6 +-
src/backend/access/table/tableamapi.c              |   2 +-
src/backend/access/transam/README                  |  14 +-
src/backend/access/transam/README.parallel         |   2 +-
src/backend/access/transam/twophase.c              |  38 +--
src/backend/access/transam/varsup.c                |   2 +-
src/backend/access/transam/xact.c                  |  40 +--
src/backend/access/transam/xloginsert.c            |  38 +--
src/backend/access/transam/xlogprefetcher.c        | 102 +++----
src/backend/access/transam/xlogreader.c            |  25 +-
src/backend/access/transam/xlogrecovery.c          |  18 +-
src/backend/access/transam/xlogutils.c             |  73 ++---
src/backend/bootstrap/bootparse.y                  |   8 +-
src/backend/catalog/catalog.c                      |  36 +--
src/backend/catalog/heap.c                         |  54 ++--
src/backend/catalog/index.c                        |  39 +--
src/backend/catalog/storage.c                      | 119 ++++----
src/backend/commands/cluster.c                     |  46 +--
src/backend/commands/copyfrom.c                    |   8 +-
src/backend/commands/dbcommands.c                  | 108 +++----
src/backend/commands/indexcmds.c                   |  16 +-
src/backend/commands/matview.c                     |   2 +-
src/backend/commands/sequence.c                    |  29 +-
src/backend/commands/tablecmds.c                   |  97 +++----
src/backend/commands/tablespace.c                  |  18 +-
src/backend/nodes/copyfuncs.c                      |   4 +-
src/backend/nodes/equalfuncs.c                     |   4 +-
src/backend/nodes/outfuncs.c                       |   4 +-
src/backend/parser/gram.y                          |   8 +-
src/backend/parser/parse_utilcmd.c                 |   8 +-
src/backend/postmaster/checkpointer.c              |   2 +-
src/backend/replication/logical/decode.c           |  40 +--
src/backend/replication/logical/reorderbuffer.c    |  52 ++--
src/backend/replication/logical/snapbuild.c        |   2 +-
src/backend/storage/buffer/bufmgr.c                | 310 ++++++++++-----------
src/backend/storage/buffer/localbuf.c              |  36 +--
src/backend/storage/freespace/freespace.c          |   6 +-
src/backend/storage/freespace/fsmpage.c            |   6 +-
src/backend/storage/ipc/standby.c                  |   8 +-
src/backend/storage/lmgr/predicate.c               |  24 +-
src/backend/storage/smgr/README                    |   2 +-
src/backend/storage/smgr/md.c                      | 126 ++++-----
src/backend/storage/smgr/smgr.c                    |  44 +--
src/backend/utils/adt/dbsize.c                     |  64 ++---
src/backend/utils/adt/pg_upgrade_support.c         |  14 +-
src/backend/utils/cache/Makefile                   |   2 +-
src/backend/utils/cache/inval.c                    |  16 +-
src/backend/utils/cache/relcache.c                 | 186 ++++++-------
.../cache/{relfilenodemap.c => relfilenumbermap.c} | 102 +++----
src/backend/utils/cache/relmapper.c                |  88 +++---
src/bin/pg_dump/pg_dump.c                          |  34 +--
src/bin/pg_rewind/datapagemap.h                    |   2 +-
src/bin/pg_rewind/filemap.c                        |  34 +--
src/bin/pg_rewind/filemap.h                        |   4 +-
src/bin/pg_rewind/parsexlog.c                      |   6 +-
src/bin/pg_rewind/pg_rewind.h                      |   2 +-
src/bin/pg_upgrade/Makefile                        |   2 +-
src/bin/pg_upgrade/info.c                          |  10 +-
src/bin/pg_upgrade/pg_upgrade.h                    |   6 +-
.../pg_upgrade/{relfilenode.c => relfilenumber.c}  |  12 +-
src/bin/pg_waldump/pg_waldump.c                    |  26 +-
src/common/relpath.c                               |  48 ++--
src/include/access/brin_xlog.h                     |   2 +-
src/include/access/ginxlog.h                       |   4 +-
src/include/access/gistxlog.h                      |   2 +-
src/include/access/heapam_xlog.h                   |   8 +-
src/include/access/nbtxlog.h                       |   4 +-
src/include/access/rewriteheap.h                   |   6 +-
src/include/access/tableam.h                       |  59 ++--
src/include/access/xact.h                          |  26 +-
src/include/access/xlog_internal.h                 |   2 +-
src/include/access/xloginsert.h                    |   8 +-
src/include/access/xlogreader.h                    |   6 +-
src/include/access/xlogrecord.h                    |   9 +-
src/include/access/xlogutils.h                     |   8 +-
src/include/catalog/binary_upgrade.h               |   6 +-
src/include/catalog/catalog.h                      |   5 +-
src/include/catalog/heap.h                         |   2 +-
src/include/catalog/index.h                        |   2 +-
src/include/catalog/storage.h                      |  10 +-
src/include/catalog/storage_xlog.h                 |   8 +-
src/include/commands/sequence.h                    |   4 +-
src/include/commands/tablecmds.h                   |   2 +-
src/include/commands/tablespace.h                  |   2 +-
src/include/common/relpath.h                       |  24 +-
src/include/nodes/parsenodes.h                     |   8 +-
src/include/postgres_ext.h                         |   7 +
src/include/postmaster/bgwriter.h                  |   2 +-
src/include/replication/reorderbuffer.h            |   6 +-
src/include/storage/buf_internals.h                |  22 +-
src/include/storage/bufmgr.h                       |  20 +-
src/include/storage/freespace.h                    |   4 +-
src/include/storage/md.h                           |   6 +-
src/include/storage/relfilelocator.h               |  99 +++++++
src/include/storage/relfilenode.h                  |  99 -------
src/include/storage/sinval.h                       |   4 +-
src/include/storage/smgr.h                         |  12 +-
src/include/storage/standby.h                      |   6 +-
src/include/storage/sync.h                         |   4 +-
src/include/utils/inval.h                          |   4 +-
src/include/utils/rel.h                            |  47 ++--
src/include/utils/relcache.h                       |   8 +-
.../utils/{relfilenodemap.h => relfilenumbermap.h} |  15 +-
src/include/utils/relmapper.h                      |  13 +-
src/test/recovery/t/018_wal_optimize.pl            |   2 +-
src/tools/pgindent/typedefs.list                   |  10 +-
138 files changed, 1640 insertions(+), 1606 deletions(-)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Remove LLVM_CONFIG from Makefile.global.in
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: pgstat: drop subscription stats regardless of slot, fix comment