heap page corruption not easy

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Mikheev, Vadim'" <vmikheev(at)SECTORBASE(dot)COM>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: heap page corruption not easy
Date: 2000-12-15 11:41:59
Message-ID: 11C1E6749A55D411A9670001FA687963368186@sdexcsrv1.f000.d0188.sd.spardat.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


A heap page corruption is not very likely in PostgreSQL because of the
underlying page design. Not even on flakey hardware/ossoftware.
(I once read a page design note from pg 4 but don't exactly remember
were or when)

The point is, that the heap page is only modified in places that were
previously empty (except header). All previous row data stays exactly
in the same place. Thus if a page is only partly written
(any order of page segments) only a new row is affected. But those rows
will be fixed during redo anyway. The only source of serious problems is
thus a bogus write of a page segment (100 bytes ok 412 bytes chunk
actually written to disk), but this case is imho sufficiently guarded or at least
detected by disk hardware.
(I assume that the page header fits into one atomic block and has no problem
with beeing one step behind or ahead of redo).

I thus doubt that we really need "physical log" for heap pages in PostgreSQL
with the current non-overwrite smgr. If we could detect corruption in index pages
we would not need physical log at all, since an index can always be recreated.

What do you think ? I ask because "physical log" is a substantial amount of
additional IO that we imho only want if it is absolutely necessary.

Andreas

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2000-12-15 12:08:26 Re: index support for arrays (GiST)
Previous Message Zeugswetter Andreas SB 2000-12-15 11:02:37 AW: switching txlog file in 7.1beta