Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit357231e

Browse files
committed
Check RELSEG_SIZE when postmaster starting up.
this is neccesary to make sure that the backend andthe database uses same RELSEG_SIZE.
1 parent6fb3c3f commit357231e

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
XLogRecPtrcheckPoint;/* last check point record ptr */
9898
time_ttime;/* time stamp of last modification */
9999
DBStatestate;/* */
100+
101+
/*
102+
* following data used to make sure that configurations for this DB
103+
* do not conflict with the backend
104+
*/
100105
uint32blcksz;/* block size for this DB */
106+
uint32relseg_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)

[8]ページ先頭

©2009-2025 Movatter.jp