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 1gfo6D-0004SG-Hw for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Jan 2019 15:42:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfo6B-0001cT-A9 for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Jan 2019 15:42:55 +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 1gfo6A-0001UC-RH for pgsql-hackers@lists.postgresql.org; Sat, 05 Jan 2019 15:42:55 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfo67-00043W-F6 for pgsql-hackers@postgresql.org; Sat, 05 Jan 2019 15:42:53 +0000 Received: by mail-qt1-x843.google.com with SMTP id y20so43477684qtm.13 for ; Sat, 05 Jan 2019 07:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=PrT1QLLO14wLKGduTKoRGW5DG3RgC4cOo8fZoGEZ8ys=; b=FpgxGB2/BSGFbkksYBwkkrzQX6CAizbUq8hkxOnnNFFisezEZn5C/+s23fTRTMNGJV eNlP9y1w21OgO/9HE4Z6TCeS+nNcnIQP/bfyb4Y98kcQjE95xWtZEomhSQySiHQI4X7E WZiesGMJ6eiMBPVDc4SDKb6YIEuqSRA+7Kk4Bq3GSayvpoozQTRSQQQJDwfyEc/xKMDh HWqeCyRzt0eTZxIfbynTfr0lRrhOU6rSOpXtrtQwkpFMM6phYyXVHycm3iUmGdSBUGcq eqBIKKBPpKN5Weh8mKh3WH6B3tWBAUSVsVihX8O4smOPIF1wJhax0IjnDq0dGwllGf2+ t/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PrT1QLLO14wLKGduTKoRGW5DG3RgC4cOo8fZoGEZ8ys=; b=W4Ry0HhZbMTpdCuPW00nx/SSlcTBKoV+O2HfQ3V8csPJeoO2NozWW5CKLUAaRhctqs iMIgBEVxI5OGkBXRbrV816BW/AR9TJKx3aWL4FQiueQsOzLFoO0nNmYPJ1/ShnE/L8/z f/5VpAGoZOgRF4D+94M0g1QYA11H+26LBDZk1w0rt8Sp7/q7qb3QJ61obyZTnecZHbUF SFG6VR/ViWO2GvVVt0xtyw2r5dwzW/YM8Uhm3cRA4LJYz/l3Fwdlg4T9SyI4C7pkeJSG xVfgIHO9iyGP/VCH3I3xToHUVyKLYa4Z1Imef2+J1RjPNqDYqKWONChmiTkyCMusF8vo +gGw== X-Gm-Message-State: AA+aEWbzGy+VKsd0mBXo9mSmVuRiL0r4Pbqg7JvQbu//YCim5cKOkR3v DDraTeF6qQJ9FLT1y0Y0jAuqTw== X-Google-Smtp-Source: AFSGD/UQN9xiB6tskNE7SV14I5TG031obIiDaEEcOOFKuqQMWsuMVsBlVnvl/mtbJsIa4ZILhud7rw== X-Received: by 2002:ac8:7451:: with SMTP id h17mr52904721qtr.319.1546702970136; Sat, 05 Jan 2019 07:42:50 -0800 (PST) Received: from alvin.alvh.no-ip.org ([201.186.80.67]) by smtp.gmail.com with ESMTPSA id q21sm33450400qtk.79.2019.01.05.07.42.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Jan 2019 07:42:49 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E5FB9805; Sat, 5 Jan 2019 12:42:47 -0300 (-03) Date: Sat, 5 Jan 2019 12:42:47 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: Use atexit() in initdb and pg_basebackup Message-ID: <201901051542.macmepgkz3zr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3d072ada-198a-f5ee-8769-bc51823d4f19@2ndquadrant.com> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-05, Peter Eisentraut wrote: > On 04/01/2019 20:35, Alvaro Herrera wrote: > >> + /* prevent cleanup */ > >> + made_new_pgdata = found_existing_pgdata = made_new_xlogdir = found_existing_xlogdir = false; > >> + > >> return 0; > >> } > > > > This is a bit ugly, but meh. > > Yeah. Actually, we already have a solution of this in pg_basebackup, > with a bool success variable. I rewrote it like that. At least it's > better for uniformity. Ah, yeah, much better, LGTM. > I also added an atexit() conversion in isolationtester. It's mostly the > same thing. LGTM in a quick eyeball. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services