Re: [HACKERS] Why we don't have checksums on clog files

2016-06-13 Thread Robert Haas
On Sun, Jun 12, 2016 at 10:54 PM, Tom Lane  wrote:
> Robert Haas  writes:
>> On Tue, Jun 7, 2016 at 10:41 AM, Amit Kapila  wrote:
>>> I think it will be better if users can have an option to checksum clog
>>> pages.  However, I think that will need a change in page (CLOG-page) format
>>> which might not be a trivial work to accomplish.
>
>> Doesn't the pd_checksum field exist on SLRU pages also?
>
> Uh, no.
>
> (I don't think that's an inherent property of slru.c, but definitely
> clog.c packs the pages totally fully of xact status bits.  See
> CLOG_XACTS_PER_PAGE.

Oh.  Well, that makes it harder, then.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Why we don't have checksums on clog files

2016-06-12 Thread Tom Lane
Robert Haas  writes:
> On Tue, Jun 7, 2016 at 10:41 AM, Amit Kapila  wrote:
>> I think it will be better if users can have an option to checksum clog
>> pages.  However, I think that will need a change in page (CLOG-page) format
>> which might not be a trivial work to accomplish.

> Doesn't the pd_checksum field exist on SLRU pages also?

Uh, no.

(I don't think that's an inherent property of slru.c, but definitely
clog.c packs the pages totally fully of xact status bits.  See
CLOG_XACTS_PER_PAGE.)

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Why we don't have checksums on clog files

2016-06-12 Thread Robert Haas
On Tue, Jun 7, 2016 at 10:41 AM, Amit Kapila  wrote:
> I think it will be better if users can have an option to checksum clog
> pages.  However, I think that will need a change in page (CLOG-page) format
> which might not be a trivial work to accomplish.

Doesn't the pd_checksum field exist on SLRU pages also?  If so, we
could just start using it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Why we don't have checksums on clog files

2016-06-07 Thread Alexander Korotkov
On Tue, Jun 7, 2016 at 5:41 PM, Amit Kapila  wrote:

> On Mon, Jun 6, 2016 at 8:43 PM, Alex Ignatov 
> wrote:
>
>> Why we don't have checksums on clog files.
>>
>> We have checksum on pg_control, optional checksumming on data files, some
>> form of checksumming on wal's. But why we don't have any checksumming on
>> clogs. Corruptions on clogs lead to transaction visisbility problems and
>> database consistency violation.
>>
>> Can anybody explain this situation with clogs?
>>
>>
> I think it will be better if users can have an option to checksum clog
> pages.  However, I think that will need a change in page (CLOG-page) format
> which might not be a trivial work to accomplish.
>

I think we should think no only about CLOG, but about all SLRU pages.
For data pages we have to reinitialize database cluster to enable
checksums. I think we can also require reinitialization to enable checksums
of SLRU pages. Thus, major problem would be that number of items fitting to
page would depend on whether checksums are enabled.  However, it shouldn't
too hard.

--
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Re: [HACKERS] Why we don't have checksums on clog files

2016-06-07 Thread Amit Kapila
On Mon, Jun 6, 2016 at 8:43 PM, Alex Ignatov 
wrote:

> Hello!
>
> Why we don't have checksums on clog files.
>
> We have checksum on pg_control, optional checksumming on data files, some
> form of checksumming on wal's. But why we don't have any checksumming on
> clogs. Corruptions on clogs lead to transaction visisbility problems and
> database consistency violation.
>
> Can anybody explain this situation with clogs?
>
>
I think it will be better if users can have an option to checksum clog
pages.  However, I think that will need a change in page (CLOG-page) format
which might not be a trivial work to accomplish.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


[HACKERS] Why we don't have checksums on clog files

2016-06-06 Thread Alex Ignatov

Hello!

Why we don't have checksums on clog files.

We have checksum on pg_control, optional checksumming on data files, 
some form of checksumming on wal's. But why we don't have any 
checksumming on clogs. Corruptions on clogs lead to transaction 
visisbility problems and database consistency violation.


Can anybody explain this situation with clogs?


--
Alex Ignatov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers