Skip to content

Commit 357231e

Browse files
committed
Check RELSEG_SIZE when postmaster starting up.
this is neccesary to make sure that the backend and the database uses same RELSEG_SIZE.
1 parent 6fb3c3f commit 357231e

File tree

1 file changed

+10
-0
lines changed
  • src/backend/access/transam

1 file changed

+10
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ typedef struct ControlFileData
9797
XLogRecPtr checkPoint; /* last check point record ptr */
9898
time_t time; /* time stamp of last modification */
9999
DBState state; /* */
100+
101+
/*
102+
* following data used to make sure that configurations for this DB
103+
* do not conflict with the backend
104+
*/
100105
uint32 blcksz; /* block size for this DB */
106+
uint32 relseg_size; /* segmented file's block number */
101107
/* MORE DATA FOLLOWS AT THE END OF THIS STRUCTURE
102108
* - locations of data dirs
103109
*/
@@ -1164,6 +1170,7 @@ BootStrapXLOG()
11641170
ControlFile->time = time(NULL);
11651171
ControlFile->state = DB_SHUTDOWNED;
11661172
ControlFile->blcksz = BLCKSZ;
1173+
ControlFile->relseg_size = RELSEG_SIZE;
11671174

11681175
if (write(fd, buffer, BLCKSZ) != BLCKSZ)
11691176
elog(STOP, "BootStrapXLOG failed to write control file: %d", errno);
@@ -1254,6 +1261,9 @@ StartupXLOG()
12541261
if (ControlFile->blcksz != BLCKSZ)
12551262
elog(STOP, "database was initialized in BLCKSZ(%d), but the backend was compiled in BLCKSZ(%d)",ControlFile->blcksz,BLCKSZ);
12561263

1264+
if (ControlFile->relseg_size != RELSEG_SIZE)
1265+
elog(STOP, "database was initialized in RELSEG_SIZE(%d), but the backend was compiled in RELSEG_SIZE(%d)",ControlFile->relseg_size, RELSEG_SIZE);
1266+
12571267
if (ControlFile->state == DB_SHUTDOWNED)
12581268
elog(LOG, "Data Base System was shutdowned at %s",
12591269
str_time(ControlFile->time));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy