Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cerrJ-0007Tf-Vc for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2017 23:22:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cerrJ-00027g-CP for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2017 23:22:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cerrB-00020J-Aq for pgsql-hackers@postgresql.org; Fri, 17 Feb 2017 23:22:29 +0000 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cerr8-0007Uh-0Z for pgsql-hackers@postgresql.org; Fri, 17 Feb 2017 23:22:28 +0000 Received: by mail-wr0-x22e.google.com with SMTP id i10so37672070wrb.0 for ; Fri, 17 Feb 2017 15:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=+4dCsmO5+cCRr4DYRvpFfC6ds5g26gWuC0EtepG3ESc=; b=J8UHOjC5Sk4m5xEVEPYA1P36XW3ArAKurjmZLfJDx7ql4oQVuL21icWPX5W1Dn7NqX FlyBXQXBVf2gUsYLMmCh70Hz8PxvFqtatMxaYACBcUOcvivDe+8uz9D60X+R9dZti0Wj Eu3Jze6PPXnKrhdLZPCb9RrIyKFU8dorsDs+bc1v4PRrVNYfggLu6NeCa9wJ8aTtTuGQ pxKq6T0hjH3HUVWvpROfU7MtBGn1Zef8fHK6kYhH5PRa1iFvwfJFi9Nvka80lr+fLfUz nkViMzDEQxSKir40gh6mPK25X2z07IpqBVn5Sco4NyGoqQNngH7Yu+htm1R84uSA9glt SEDw== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=+4dCsmO5+cCRr4DYRvpFfC6ds5g26gWuC0EtepG3ESc=; b=pjI975wA7wtJ/z2nYZttqZ9b7KnXuvZIN1AqnFq35V1h8GZf6k4grFq3gwDHQt0yfM d4ZnqbzmfGJ8e0dOloB742roMAZ1SaOrxOmVcJLdjs8pVGy6oxZKhu6tn/0sri2tCkGO QVl6uJ4ZlP1XOl7YsznjB+rVGXpSuSJX9t+QkgZluUvKUNl7GU76eJKcdgaAn2bgf0A3 amj8EeLUvuG8oOEfKROUA70hSHuIhjwYWmhOAopYJTJaz2C/FCPmw00LrqD1KOVn91BK wSITjbxyNq6K7yqdUHSeiy4SYUEE5U6tyF6D0nQK5sORSt+AE2CHKm1dcA/O+dOS972J scSw== X-Gm-Message-State: AMke39lysVhJQBpXmU1tf0TLnj/sLTpMPADQSqDZPNX/INWSpcN2C0Q+tJnoF36yHCz1jiWXtOPmrusAJf0BUE711NiDqg0Bxr33Uk3lqbopQHZJTfThuk8geCgeaCvAomCG29C6sgI9HOgvrg57oOLVCTAvb177gGEivRtET5yIEDb108gF+rytxVVlliwhxHHqi7hnNXEG X-Received: by 10.223.175.71 with SMTP id z65mr9392674wrc.84.1487373744920; Fri, 17 Feb 2017 15:22:24 -0800 (PST) Received: from [10.137.2.17] (ip-89-177-46-65.net.upcbroadband.cz. [89.177.46.65]) by smtp.gmail.com with ESMTPSA id w204sm3387795wmd.17.2017.02.17.15.22.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 15:22:24 -0800 (PST) Subject: Re: gitlab post-mortem: pg_basebackup waiting for checkpoint To: Jim Nasby , Robert Haas , Alvaro Herrera References: <20170214210651.ldwzk6frxxclbomw@alvherre.pgsql> Cc: Magnus Hagander , Michael Banck , Pg Hackers From: Tomas Vondra Message-ID: Date: Sat, 18 Feb 2017 00:22:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 02/17/2017 08:17 PM, Jim Nasby wrote: > On 2/14/17 5:18 PM, Robert Haas wrote: >> On Tue, Feb 14, 2017 at 4:06 PM, Alvaro Herrera >> wrote: >>> I'd rather have a --quiet mode instead. If you're running it by hand, >>> you're likely to omit the switch, whereas when writing the cron job >>> you're going to notice lack of switch even before you let the job run >>> once. >> >> Well, that might've been a better way to design it, but changing it >> now would break backward compatibility and I'm not really sure that's > > Meh... it's really only going to affect cronjobs or scripts, which are > easy enough to fix, and you're not going to have that many of them (or > if you do you certainly have an automated way to push the update). > I think you're underestimating the breakage and overestimating how easy it's going to be to it. It's true we'd only change this in a major version, so people should assume possible breakage and test. >> a good idea. Even if it is, it's a separate concern from whether or >> not in the less-quiet mode we should point out that we're waiting for >> a checkpoint on the server side. > > Well, --quite was suggested because of confusion from pg_basebackup > twiddling it's thumbs... I'm in favor of the '--verbose' route. People are used to that when investigating issues, and it does not break existing cron jobs. I can live with --quiet though, as long as we don't resort to some craziness along the lines "if there's tty be verbose, otherwise be quiet". I have my doubts about this actually addressing gitlab-like mistakes, though, because it's a helluva jump from "It's waiting and not doing anything," to "We need to remove the datadir." (One of the reasons being that non-empty directory is a local issue, and there's no reason why the tool should wait instead of just reporting an error.) FWIW before messing with the pg_basebackup code, perhaps we should improve the documentation and explain clearly the meaning of 'fast' and 'spread' checkpoint modes. Right now, pg_basebackup docs only say this: Sets checkpoint mode to fast or spread (default) (see Section 24.3.3). which is pretty damn useless, when you're investigating an issue. And the referenced section (Making a Base Backup Using the Low Level API) does not clearly explain how this maps to pg_start_backup(_,?). What about adding a paragraph into pg_basebackup docs, explaining that with 'fast' it does immediate checkpoint, while with 'spread' it'll wait for a spread checkpoint. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers