Subject Re: [IB-Architect] Disk data integrity (was: Torn Page detection)
Author Steen Jansdal
> I don't understand how the mssql torn page algorithm works.
> Would somebody explain to me, slowly, and in little words,
> how you can flip arbitrary bits on say a TIP page without
> causing chaos?

I can try to explain how MSSQL implements
this torn page algoritm:

Each page is 8Kb or 16 sectors of 512 bytes.
In the header of each page 16 bits are reserved
for torn bits. Before writing a page to disk
one bit from each of the 16 sectors (I don't
know which bit) are copied to the torn bits
field in the header, and the torn bits in
each sector are set to 1. The next time the
same page are written to disk the torn bits
are set to 0 (zero). When a page is read from
disk the opposite is done, copying bits from
the torn bits field in the header to the torn
bits in all 16 sectors.

Best regards

Steen Jansdal