Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYlVl-0007tI-9y for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2018 04:27:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYlVj-000727-ML for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2018 04:27:39 +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 1eYlVj-00071t-Di; Tue, 09 Jan 2018 04:27:39 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eYlVb-0007ZE-9a; Tue, 09 Jan 2018 04:27:38 +0000 Received: by mail-pg0-x243.google.com with SMTP id z17so1247347pgc.4; Mon, 08 Jan 2018 20:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Gyge/h+FxPlSaFA5H1pW2zoDyLw1sVvINF1Dv8HaAUc=; b=n8Wz8NgV9U/lDHQQ2LrGZk5ZikIjtF4zXnnbdTClolRbnLUdnjCdKv1ycUYoCwdYEy 34I5JjNezPONhqKQ0rPzF4StEraRL6Qg5B8xHJagmFSx5gRWv89VYF29hKoE2ckann+G CDcVrPu2pspTUDgICQSZ8ce5EY7ZD+xyVnBbohtT1rEJHxMy0cm8s0tI/5yG0COwZy6T BG5eFBdfMYxXJ80Yd3DBrt21714csOa2oHxFYxnM+FwT0UUEMSpF/JoBt/WHIU0qjEgq Tl8RpwaIyFQcxwqauRI38JYSN3TQtwW2oykzHNUiIlCBaBwx3PGHP82wpSgujguiXu5Q F2aQ== 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:references :mime-version:content-disposition:in-reply-to; bh=Gyge/h+FxPlSaFA5H1pW2zoDyLw1sVvINF1Dv8HaAUc=; b=Stau9j30g1ZjNAy2Zgznwo5lnEs43JAXBwYZkwGNAZZnlZxzSOwIdxlit0L2X/dsoc +osg4+NcFeKoRYExlV5tZ3UI3sHqz274U/m+hrvl0f9NE2rwXSPlz0iv1pyPjHFPGC+r VGAT5bdY/bfKb7195GuI9bLlw2ziaRr7Fq+xpuo/cL+NWeuQT4Yooy+ySBgrUegSqwjk nm/42aVil67lPEylfjZ1x4fE8m5U6kicrJN8E5KByGyp9TnmQjbxoiG8NKEE5IabZhnC +X85bPce5UXgII3Fm0nCqw/FnYbNW3fIjipfH1iS7j9l3O9aXgcDSX5zPN2FalX8bd1H 7myg== X-Gm-Message-State: AKGB3mIlXQ3qCfvu157wahsjFgJ8TwIDiM8TnEzaZmDorE/rGp4EaIDQ +pxc64QIcYut1oHh5+SwTlw= X-Google-Smtp-Source: ACJfBouUUVXtFvG0wPW8WjmHfu7zM6z/4BpAr6lo4EvImNiY6WgplDAlDoTBEme1x+uofarD5Sd5sQ== X-Received: by 10.101.76.203 with SMTP id n11mr10733745pgt.405.1515472048624; Mon, 08 Jan 2018 20:27:28 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id g2sm8574734pfh.62.2018.01.08.20.27.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 20:27:26 -0800 (PST) Date: Tue, 9 Jan 2018 13:27:20 +0900 From: Michael Paquier To: "Bossart, Nathan" Cc: Masahiko Sawada , Robert Haas , Lyes Ameddah , Tomas Vondra , "pgsql-hackers@postgresql.org" , "pgsql-bugs@postgresql.org" Subject: Re: BUG #14941: Vacuum crashes Message-ID: <20180109042720.GG76418@paquier.xyz> References: <48A02BB8-A7DE-4D11-9586-0BBE5E6FE4F3@amazon.com> <32F4B778-292B-41AF-891A-497B8127CD59@amazon.com> <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wHh0aNzodMFDTGdO" Content-Disposition: inline In-Reply-To: <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --wHh0aNzodMFDTGdO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 28, 2017 at 10:46:18PM +0000, Bossart, Nathan wrote: > I agree, this makes more sense. I've made this change in v3 of 0003. Based on the opinions gathered on this thread, 0001 and 0002 seem to be in the shape wanted, and those look good for shipping. Now for 0003 we are not there yet. - if (relation == NULL) + if (relation != NULL) + relname = relation->relname; + else if (!rel_lock) + relname = get_rel_name(relid); + + if (relname == NULL) I think that you are doing it wrong here. In get_all_vacuum_rels() you should build a RangeVar to be reused in the context of this error message, and hence you'll save an extra lookup based on the relation OID here, saving from any timing issues that you have overseen as in this code path a lock on the relation whose name is looked at is not taken. Relying on the RangeVar being NULL to not generate any logs is fine as a concept to me, but let's fill it where it is needed, and in the case of this patch a VACUUM NOWAIT on the whole database is such a case. -- Michael --wHh0aNzodMFDTGdO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpURKgACgkQnvQgOdby QH22kQ/+I1BNrkdtH4adV7Lut2bFjkWG9/LeAoArOvQ0mhWFT4+iE1u4uhSh5Uh9 JPOUglrji4p5Z6YSvjydIpcHlB3wDkYdncb5Xtvjjxpz05VBQIyB1mD5iNURBjhf FSy55u9OsAVsN1xTqUgmEMyJ/0LT07kEeLlBhvfVJwb+pHC4WLS78ekc1RUNYgRm WQ3qNnzIb5kqyPPOSdzmDTbHs2jxJ+HsXh6hjiMV37OQPNdCRIiXVFeSDaAzVgZG NA86dsrwT6ER6hGD2Lq215jz5tpyK0cxxuY+ObCpxKhbVQ/EDeAhAL7rJ7UbSkUr Ka5aJUyE8O1D8tuy2xgLyYEQUxAUK6E1T+dr5bmZ1R6js97R2p2SUFUqwWtyq+p0 VsFP9b8mZeJyw5pMADGZviVtMrdn9NcitF7obFWGBj4NXq6Ayd4uhAfIEQPSD5ls 3x36U+MIK1vNBBHnsycdGaj+MQGgNnzWGvfGwdopU+FSt2IllCDS0oD2hvY7NWek v3W6htjL+WqPrBO4bI2c1yQ9ORfnfaHMSpoyC37aksDS6fp+RuD+6fHnbDpr6lfU n6L0jDVmjGy/ILZamP32DhdVKKTjDI+yTpottebl5tL3CHVK+JtSaizsSQEOveTU sDLpnoAF44dcq26ouZe9HlV20kUvLfoR8YPv6DiLm33538SV1d0= =0QH0 -----END PGP SIGNATURE----- --wHh0aNzodMFDTGdO--