1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-21 02:52:47 +03:00

Revert 56-bit relfilenode change and follow-up commits.

There are still some alignment-related failures in the buildfarm,
which might or might not be able to be fixed quickly, but I've also
just realized that it increased the size of many WAL records by 4 bytes
because a block reference contains a RelFileLocator. The effect of that
hasn't been studied or discussed, so revert for now.
This commit is contained in:
Robert Haas
2022-09-28 09:45:27 -04:00
parent 6af0827232
commit a448e49bcb
73 changed files with 304 additions and 719 deletions

View File

@@ -15,7 +15,6 @@
#define TRANSAM_H
#include "access/xlogdefs.h"
#include "common/relpath.h"
/* ----------------
@@ -197,33 +196,6 @@ FullTransactionIdAdvance(FullTransactionId *dest)
#define FirstUnpinnedObjectId 12000
#define FirstNormalObjectId 16384
/* ----------
* RelFileNumbers are normally assigned sequentially beginning with
* FirstNormalRelFileNumber, but for system tables the initial RelFileNumber
* is equal to the table OID. This scheme allows pg_upgrade to work: we expect
* that the new cluster will contain only system tables, and that none of those
* will have previously been rewritten, so any RelFileNumber which is in use
* in both the old and new clusters will be used for the same relation in both
* places.
*
* This is important because pg_upgrade can't reactively move conflicting
* relations out of the way. If it tries to set the RelFileNumber for a
* relation to some value that's already in use by a different relation, the
* upgrade will just fail. It's OK if the same RelFileNumber is used for the
* same relation, though, since then nothing needs to be changed.
* ----------
*/
#define FirstNormalRelFileNumber ((RelFileNumber) 100000)
#define CHECK_RELFILENUMBER_RANGE(relfilenumber) \
do { \
if ((relfilenumber) < 0 || (relfilenumber) > MAX_RELFILENUMBER) \
ereport(ERROR, \
errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
errmsg("relfilenumber %llu is out of range", \
(unsigned long long) (relfilenumber))); \
} while (0)
/*
* VariableCache is a data structure in shared memory that is used to track
* OID and XID assignment state. For largely historical reasons, there is
@@ -242,15 +214,6 @@ typedef struct VariableCacheData
Oid nextOid; /* next OID to assign */
uint32 oidCount; /* OIDs available before must do XLOG work */
/*
* These fields are protected by RelFileNumberGenLock.
*/
RelFileNumber nextRelFileNumber; /* next relfilenumber to assign */
RelFileNumber loggedRelFileNumber; /* last logged relfilenumber */
RelFileNumber flushedRelFileNumber; /* last flushed relfilenumber */
XLogRecPtr loggedRelFileNumberRecPtr; /* xlog record pointer w.r.t.
* loggedRelFileNumber */
/*
* These fields are protected by XidGenLock.
*/
@@ -330,9 +293,6 @@ extern void SetTransactionIdLimit(TransactionId oldest_datfrozenxid,
extern void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid);
extern bool ForceTransactionIdLimitUpdate(void);
extern Oid GetNewObjectId(void);
extern RelFileNumber GetNewRelFileNumber(Oid reltablespace,
char relpersistence);
extern void SetNextRelFileNumber(RelFileNumber relnumber);
extern void StopGeneratingPinnedObjectIds(void);
#ifdef USE_ASSERT_CHECKING

View File

@@ -236,7 +236,6 @@ extern void CreateCheckPoint(int flags);
extern bool CreateRestartPoint(int flags);
extern WALAvailability GetWALAvailability(XLogRecPtr targetLSN);
extern void XLogPutNextOid(Oid nextOid);
extern XLogRecPtr LogNextRelFileNumber(RelFileNumber nextrelnumber);
extern XLogRecPtr XLogRestorePoint(const char *rpName);
extern void UpdateFullPageWrites(void);
extern void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p);