Re: [HACKERS] 7.0.2 -> 7.0.3 problem - anyone? - Fixed!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mitch Vincent" <mitch(at)venux(dot)net>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] 7.0.2 -> 7.0.3 problem - anyone? - Fixed!
Date: 2000-11-13 05:34:51
Message-ID: 5536.974093691@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I said:
> if (ControlFile->blcksz != BLCKSZ)
> elog(STOP, "database was initialized with BLCKSZ %d,\n\tbut the backend was compiled with BLCKSZ %d.\n\tlooks like you need to initdb.",
ControlFile-> blcksz, BLCKSZ);

> But I haven't stress-tested it. From your report, it sounds like
> something may blow up before control gets to this point if the compiled
> BLCKSZ is larger than the value used by initdb :-(

Oh ... duh! Three statements before the above test, we read in the
pg_control data with

if (read(fd, ControlFile, BLCKSZ) != BLCKSZ)
elog(STOP, "Read(\"%s\") failed: %d", ControlFilePath, errno);

Now pg_control is only a one-block file anyway. So if it was written
with a smaller BLCKSZ than the backend is expecting, the read() will
indeed not read as many bytes as the code is expecting --- whereupon
it fails with this not-so-informative error message instead of the
one that would be useful.

Easy to fix, now that we've had our noses rubbed in the problem.
Thanks for the report, and sorry you were confused for awhile...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Don Baccus 2000-11-13 05:46:06 Re: [HACKERS] PHPBuilder article -- Postgres vs MySQL
Previous Message Tom Lane 2000-11-13 05:21:35 Re: [HACKERS] 7.0.2 -> 7.0.3 problem - anyone? - Fixed!

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-11-13 05:46:06 Re: [HACKERS] PHPBuilder article -- Postgres vs MySQL
Previous Message Bruce Momjian 2000-11-13 05:33:46 Re: PostgreSQL virtual hosting support