From 851f4cc75cdd8c831f1baa9a7abf8c8248b65890 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 28 Jul 2022 10:08:10 -0400 Subject: Clean up some residual confusion between OIDs and RelFileNumbers. Commit b0a55e43299c4ea2a9a8c757f9c26352407d0ccc missed a few places where we are referring to the number used as a part of the relation filename as an "OID". We now want to call that a "RelFileNumber". Some of these places actually made it sound like the OID in question is pg_class.oid rather than pg_class.relfilenode, which is especially good to clean up. Dilip Kumar with some editing by me. --- src/backend/replication/basebackup.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/backend/replication/basebackup.c') diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 637c0ce4597..7f85071229b 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -1172,7 +1172,8 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly, int excludeIdx; bool excludeFound; ForkNumber relForkNum; /* Type of fork if file is a relation */ - int relOidChars; /* Chars in filename that are the rel oid */ + int relnumchars; /* Chars in filename that are the + * relnumber */ /* Skip special stuff */ if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) @@ -1222,23 +1223,24 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly, /* Exclude all forks for unlogged tables except the init fork */ if (isDbDir && - parse_filename_for_nontemp_relation(de->d_name, &relOidChars, + parse_filename_for_nontemp_relation(de->d_name, &relnumchars, &relForkNum)) { /* Never exclude init forks */ if (relForkNum != INIT_FORKNUM) { char initForkFile[MAXPGPATH]; - char relOid[OIDCHARS + 1]; + char relNumber[OIDCHARS + 1]; /* * If any other type of fork, check if there is an init fork - * with the same OID. If so, the file can be excluded. + * with the same RelFileNumber. If so, the file can be + * excluded. */ - memcpy(relOid, de->d_name, relOidChars); - relOid[relOidChars] = '\0'; + memcpy(relNumber, de->d_name, relnumchars); + relNumber[relnumchars] = '\0'; snprintf(initForkFile, sizeof(initForkFile), "%s/%s_init", - path, relOid); + path, relNumber); if (lstat(initForkFile, &statbuf) == 0) { -- cgit v1.2.3