Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcWwB-0007wD-GE for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 14:47:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gcWwA-00036x-1t for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 14:47:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcWw9-00036q-JC for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 14:47:01 +0000 Received: from mail-yw1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcWw1-00075P-Pe for pgsql-hackers@postgresql.org; Thu, 27 Dec 2018 14:47:00 +0000 Received: by mail-yw1-xc2c.google.com with SMTP id j6so6612195ywj.6 for ; Thu, 27 Dec 2018 06:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ba0S43Cl0MvhS+psbABjEubfHKy+lZwZYfuaxqp/rUA=; b=bh+YHUKvN0lwNprePfi7mfThjWz8gLQpaV5H9WxULUMWcqCA0lt7J56MEIuSxIoNIF axfyDoJ0nXh8tRvOeZohTxpjidgPmpxNend9JkdPS/3lVqL0il+gncEG4xKL/lx9zEUl 2t6hFNP0geVgODQohEVGQZnWczo5XTQ1C3asFODW7o40F1ml51eQPBtM5scaqPIimK6k FWXiFzqWQenk1tezF3A5nCq4ZVM8HCAaR/ovl1gFRs3dl5FB12HuYXocjbdW575HJOGw +nQEvKAJV9D725DgWqbqVzm699J06ONUJduoQRSJpUz2RPdVfRcfB/h7Sgo7C0uzd+3T LLdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ba0S43Cl0MvhS+psbABjEubfHKy+lZwZYfuaxqp/rUA=; b=OKCqfRq47VTNwC0aCumbLmwr8qADmiNd/X7ceekdUkKPhnS3ACEPEmLZ2IdrY0tMII Mxpy434D80NPHo8ddSL3xZ5PG7bI6QhTZH9lFJOSBLudrih27jY7DEwDftzTgAht2Mkd WLC+wXZBDfKXvCl5+PrnwAmt+P+50W56sXFvIJku9BYeUgPBgDUBv1EiVJQsKVSSJqTQ QkggvRRzyOv8sJSajnJ0X4f0Wq0aBg51u47e28Pj/q+7n//msSpJ7h0tLgdv9geUzDED M2OxovR+r8gYePTIcF0CeVBZJxdh4TaQd5WwrKO5iQgUG6HZR6PrzN7j02DVyQ8M9FQr BoyQ== X-Gm-Message-State: AA+aEWaszIvaa43ealFHOKm1fih2aKRaeLPfPZy/OtPFZCDWmHmSe8Pj rl4hWJP61r2M+iDJyLpqgjsVccSMWt09YJ8h/f0/nT3hkkTv7uRP83qTU4O0dfrTeZvRloYX32m gluyjNNw+90lfUb/pKh8p4zWO4gLU35SXaWLUFuCzovAR1VOZz0/4+yBg5XNewSYhclbZCePTn7 jCzs5U4aEM11IR5j0z X-Google-Smtp-Source: AFSGD/XYdk2AK/4LkJRVukR24hPzLcKy899odQx+zIvKHdYm9AmWMA58zFA7qPy51WCqmyLZWt0NWQ== X-Received: by 2002:a81:a943:: with SMTP id g64mr24680588ywh.374.1545922011975; Thu, 27 Dec 2018 06:46:51 -0800 (PST) Received: from [10.137.2.21] ([151.217.241.158]) by smtp.gmail.com with ESMTPSA id p201sm17513140ywe.45.2018.12.27.06.46.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 06:46:51 -0800 (PST) Subject: Re: Offline enabling/disabling of data checksums To: Magnus Hagander , Michael Paquier Cc: Michael Banck , Postgres hackers References: <20181221201616.GD4974@nighthawk.caipicrew.dd-dns.de> <20181221232834.GB1948@paquier.xyz> From: Tomas Vondra Message-ID: <348aef85-a967-80d2-7bef-7274909475cf@2ndquadrant.com> Date: Thu, 27 Dec 2018 15:46:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/27/18 11:43 AM, Magnus Hagander wrote: > > > On Sat, Dec 22, 2018 at 12:28 AM Michael Paquier > wrote: > > On Fri, Dec 21, 2018 at 09:16:16PM +0100, Michael Banck wrote: > > I think that this is independently useful, I got this stuff part of an > upgrade workflow where the user is ready to accept some extra one-time > offline time so as checksums are enabled. > > > Very much so, IMHO. > > > > Things I have not done so far: > > > > 1. Rename pg_verify_checksums to e.g. pg_checksums as it will no > longer > > only verify checksums. > > Check.  That sounds right to me. > > > Should we double-check with packagers that this won't cause a problem? > Though the fact that it's done in a major release should make it > perfectly fine I think -- and it's a smaller change than when we did all > those xlog->wal changes... > I think it makes little sense to not rename the tool now. I'm pretty sure we'd end up doing that sooner or later anyway, and we'll just live with a misnamed tool until then. > > > 3. Once that patch is in, there would be a way to disable checksums so > > there'd be a case to also change the initdb default to enabled, > but that > > required further discussion (and maybe another round of benchmarks). > > Perhaps, that's unrelated to this thread though.  I am not sure that > all users would be ready to pay the extra cost of checksums enabled by > default. > > > I'd be a strong +1 for changing the default once we have a painless way > to turn them off. > > It remains super-cheap to turn them off (stop database, one command, > turn them on). So those people that aren't willing to pay the overhead > of checksums, can very cheaply get away from it. > > It's a lot more expensive to turn them on once your database has grown > to some size (definitely in offline mode, but also in an online mode > when we get that one in). > > Plus, the majority of people *should* want them on :) We don't run with > say synchronous_commit=off by default either to make it easier on those > that don't want to pay the overhead of full data safety :P (I know it's > not a direct match, but you get the idea) > I don't know, TBH. I agree making the on/off change cheaper makes moves us closer to 'on' by default, because they may disable it if needed. But it's not the whole story. If we enable checksums by default, 99% users will have them enabled. That means more people will actually observe data corruption cases that went unnoticed so far. What shall we do with that? We don't have very good answers to that (tooling, docs) and I'd say "disable checksums" is not a particularly amazing response in this case :-( FWIW I don't know what to do about that. We certainly can't prevent the data corruption, but maybe we could help with fixing it (although that's bound to be low-level work). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services