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 1gcX2s-0008K8-UL for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 14:53:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gcX2r-0008S5-Gz for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 14:53:57 +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 1gcX2r-0008Rt-6m for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 14:53:57 +0000 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcX2m-0007Da-9p for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 14:53:55 +0000 Received: by mail-yw1-xc43.google.com with SMTP id h32so7382073ywk.2 for ; Thu, 27 Dec 2018 06:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=12OjzkiHZQ10KykQ7RDGqEGWRsIAqj8mRrw070t6P94=; b=FCbM1CQntv7EIi0bShrArIElgiPgFzDKHBBoUYcNBZsJ6EorPcPvoxT1yUCsrWHkg/ cFvsCaqijHXzEhyFx9bBDxoHv7Sn55o/lnDBUYHHxCWiY8KqZelaIrIPLiLpj30EK3bx Dk6buUBs9p4jbyjRLkrM/sSxvtiZrRN3vaQNOwr2bE0e9RSlNI9/nkpKpo2ZiIdFJDHO ZP16GEMYkVPBxEYTNWsBVFAPphBz65SOH3Tgv03DQfUjSRLGmJob0zK7CiI92Pzk/tmh BbPNcsM7gMH1PDcanL37N239GZFkUFDqNiz9C3/hMBXQawo+5rfhKd8STDT86KWAI+Cw Rvhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=12OjzkiHZQ10KykQ7RDGqEGWRsIAqj8mRrw070t6P94=; b=a4/dkPMxxUTV2DeXewsjc4y+gzCj0wUD2FHKwY3dVcxO116McJYxUqzTe7YAMgVatA XdFFIADXBIxD4nLZ1DciNw89+TJ9bvYTyVZmuh4ENKCLYrcZwrPOcmyPtJiTK21j04Cn aJYjYBMQHigkLtvw0Si3kINSCn4XSIgqPSM5XmtVgFRLDZK4TdE6EA73pY9etbEDEldW JGAUmowh1/8GnfjtNLtcBo6LJwAk4wRYX/vXWgEUpXdbwBN4SD6xJV/1DXuY4Df2pHRY qANaGZk8pI1SCtzjsdpnD+wVzdbJwlKpoC65589X4RWAVqIe7pxmc6H+Yqtpany0R7Jf /42w== X-Gm-Message-State: AA+aEWaUWsUkAjJGgET2lU8uyESsEYP+fbPJcLt/eawSMwH+lTOzo3PL jgUwUk+dh1v8aeP7a+s+XpatOPZvWKz7kuaG1I/ZbGsjAiCO3CVMFc/T1+dMOm2veip8BVvrMrh mFp0NE0dr1jDoiMfIzmgBRGXhzC3HZyrHfFxXxzeHwDf2TN/OWtjfHw5atbLeaY15+frJNVR5xu SdspvJ/XP02IJOUw4rz8oEERCG X-Google-Smtp-Source: AFSGD/W7IieQRanhi/9D3x3yykD+uBtnfR6C9hUyWWjcOmvD4YsKH3UC7nAmm/YGDsVLMfx7Ioa4FA== X-Received: by 2002:a81:7b88:: with SMTP id w130mr24016052ywc.156.1545922430884; Thu, 27 Dec 2018 06:53:50 -0800 (PST) Received: from [10.137.2.21] ([151.217.241.158]) by smtp.gmail.com with ESMTPSA id v191sm14648537ywc.102.2018.12.27.06.53.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 06:53:50 -0800 (PST) Subject: Re: Offline enabling/disabling of data checksums To: pgsql-hackers@lists.postgresql.org References: <20181221201616.GD4974@nighthawk.caipicrew.dd-dns.de> <20181227011534.GD2106@paquier.xyz> From: Tomas Vondra Message-ID: Date: Thu, 27 Dec 2018 15:53:47 +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:39 AM, Magnus Hagander wrote: > > > On Thu, Dec 27, 2018 at 2:15 AM Michael Paquier > wrote: > > On Wed, Dec 26, 2018 at 07:43:17PM +0100, Fabien COELHO wrote: > >> It adds an (now mandatory) --action parameter that takes either > verify, > >> enable or disable as argument. > > > > I'd rather have explicit switches for verify, enable & disable, > and verify > > would be the default if none is provided. > > Okay, noted for the separate switches.  But I don't agree with the > point of assuming that --verify should be enforced if no switches are > defined.  That feels like a trap for newcomers of this tool.. > > > Defaulting to the choice that makes no actual changes to the data surely > is the safe choice,a nd not a trap :) > > That said, this would probably be our first tool where you switch it > between readonly and rewrite mode with just a switch, woudn't it? All > other tools are either read-only or read/write at the *tool* level, not > the switch level. > Eh? Isn't pg_rewind "modify by default" with --dry-run switch to run in a read-only mode. So I'm not sure what you mean by "tool level" here. FWIW I'd prefer sticking to the same approach for this tool too, i.e. have a "dry-run" switch that makes it read-only. IMHO that's pretty common pattern. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services