pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Banck <michael.banck@credativ.de>
To: Magnus Hagander <magnus@hagander.net>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Offline enabling/disabling of data checksums
Date: Wed, 13 Mar 2019 12:29:21 +0100
Message-ID: <1552476561.4947.67.camel@credativ.de> (raw)
In-Reply-To: <CABUevEzM86WSaap-OZ0Dfou8T07NN1ki5B67xd0u8UeZEpqT5Q@mail.gmail.com>
References: <20181221201616.GD4974@nighthawk.caipicrew.dd-dns.de>
	<20190311045323.GE1818@paquier.xyz>
	<155231347133.16480.11453587097036807558.pgcf@coridan.postgresql.org>
	<1552385626.4947.50.camel@credativ.de>
	<20190312124403.GM13812@paquier.xyz>
	<20190313021621.GP13812@paquier.xyz>
	<alpine.DEB.2.21.1903130805330.4059@lancre>
	<20190313093150.GE2988@paquier.xyz>
	<alpine.DEB.2.21.1903131037240.4059@lancre>
	<20190313101021.GF2988@paquier.xyz>
	<5217311552474471@myt2-66bcb87429e6.qloud-c.yandex.net>
	<CABUevEzM86WSaap-OZ0Dfou8T07NN1ki5B67xd0u8UeZEpqT5Q@mail.gmail.com>

Hi,

Am Mittwoch, den 13.03.2019, 12:24 +0100 schrieb Magnus Hagander:
> > Also we support ./configure --with-blocksize=(not equals 8)? make
> > check on HEAD fails for me. If we support this - i think we need
> > recheck BLCKSZ between compiled pg_checksum and used in PGDATA
> 
> You mean if the backend and pg_checksums is built with different
> blocksize? Yeah, that sounds like something which is a cheap check and
> should be done. 

I've been doing that in my pg_checksums fork for a while (as it further
removed from the Postgres binaries) but yeah we should check for that as
well in pg_checksums, see attached patch.


Michael

-- 
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax:  +49 2166 9901-100
Email: michael.banck@credativ.de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz

Attachments:

  [text/x-patch] 0001-Check-data-directory-block-size.patch (1008B, ../1552476561.4947.67.camel@credativ.de/2-0001-Check-data-directory-block-size.patch)
  download | inline diff:
From f942136e09cd54b1032c7c5d9b4f3305e7dc043f Mon Sep 17 00:00:00 2001
From: Michael Banck <mbanck@debian.org>
Date: Wed, 13 Mar 2019 12:27:44 +0100
Subject: [PATCH] Check data directory block size

---
 src/bin/pg_checksums/pg_checksums.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
index afca6cf027..dfd522ca6a 100644
--- a/src/bin/pg_checksums/pg_checksums.c
+++ b/src/bin/pg_checksums/pg_checksums.c
@@ -442,6 +442,17 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 
+	/*
+	 * Check that the PGDATA blocksize is the same as the one pg_checksums
+	 * was compiled against (BLCKSZ).
+	 */
+	if (ControlFile->blcksz != BLCKSZ)
+	{
+		fprintf(stderr, _("%s: data directory block size %d is different to compiled-in block size %d.\n"),
+				progname, ControlFile->blcksz, BLCKSZ);
+		exit(1);
+	}
+
 	/* Save time of last control file modification */
 	controlfile_last_updated = ControlFile->time;
 
-- 
2.11.0



view thread (149+ messages)  latest in thread

Message-ID: <1552476561.4947.67.camel@credativ.de>
Permalink:  ../1552476561.4947.67.camel@credativ.de/
Also on:    postgresql.org/message-id/1552476561.4947.67.camel@credativ.de

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: michael.banck@credativ.de, magnus@hagander.net, sk@zsrv.org, michael@paquier.xyz, coelho@cri.ensmp.fr, pgsql-hackers@lists.postgresql.org
  Subject: Re: Offline enabling/disabling of data checksums
  In-Reply-To: <1552476561.4947.67.camel@credativ.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox