From 7adb1b0072f45e3346b76938b6a6b4d699660cf4 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Tue, 12 Oct 1999 10:21:56 +0000 Subject: [PATCH] Add blcksz to struct ControlFileData to check BLCKSZ is same as BLCKSZ which the backend was compiled in. --- src/backend/access/transam/xlog.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 09605cf947..592a3a5bf7 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -97,6 +97,7 @@ typedef struct ControlFileData XLogRecPtr checkPoint; /* last check point record ptr */ time_t time; /* time stamp of last modification */ DBState state; /* */ + uint32 blcksz; /* block size for this DB */ /* MORE DATA FOLLOWS AT THE END OF THIS STRUCTURE * - locations of data dirs */ @@ -1162,6 +1163,7 @@ BootStrapXLOG() ControlFile->checkPoint = checkPoint.redo; ControlFile->time = time(NULL); ControlFile->state = DB_SHUTDOWNED; + ControlFile->blcksz = BLCKSZ; if (write(fd, buffer, BLCKSZ) != BLCKSZ) elog(STOP, "BootStrapXLOG failed to write control file: %d", errno); @@ -1249,6 +1251,9 @@ tryAgain: !XRecOffIsValid(ControlFile->checkPoint.xrecoff)) elog(STOP, "Control file context is broken"); + if (ControlFile->blcksz != BLCKSZ) + elog(STOP, "database was initialized in BLCKSZ(%d), but the backend was compiled in BLCKSZ(%d)",ControlFile->blcksz,BLCKSZ); + if (ControlFile->state == DB_SHUTDOWNED) elog(LOG, "Data Base System was shutdowned at %s", str_time(ControlFile->time));