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

Commit7adb1b0

Browse files
committed
Add blcksz to struct ControlFileData to check BLCKSZ is same
as BLCKSZ which the backend was compiled in.
1 parent433c213 commit7adb1b0

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ typedef struct ControlFileData
9797
XLogRecPtrcheckPoint;/* last check point record ptr */
9898
time_ttime;/* time stamp of last modification */
9999
DBStatestate;/* */
100+
uint32blcksz;/* block size for this DB */
100101
/* MORE DATA FOLLOWS AT THE END OF THIS STRUCTURE
101102
* - locations of data dirs
102103
*/
@@ -1162,6 +1163,7 @@ BootStrapXLOG()
11621163
ControlFile->checkPoint=checkPoint.redo;
11631164
ControlFile->time=time(NULL);
11641165
ControlFile->state=DB_SHUTDOWNED;
1166+
ControlFile->blcksz=BLCKSZ;
11651167

11661168
if (write(fd,buffer,BLCKSZ)!=BLCKSZ)
11671169
elog(STOP,"BootStrapXLOG failed to write control file: %d",errno);
@@ -1249,6 +1251,9 @@ StartupXLOG()
12491251
!XRecOffIsValid(ControlFile->checkPoint.xrecoff))
12501252
elog(STOP,"Control file context is broken");
12511253

1254+
if (ControlFile->blcksz!=BLCKSZ)
1255+
elog(STOP,"database was initialized in BLCKSZ(%d), but the backend was compiled in BLCKSZ(%d)",ControlFile->blcksz,BLCKSZ);
1256+
12521257
if (ControlFile->state==DB_SHUTDOWNED)
12531258
elog(LOG,"Data Base System was shutdowned at %s",
12541259
str_time(ControlFile->time));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp