Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ6WQ-0003CD-BT for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jan 2018 02:53:46 +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 1eZ6WO-0003o3-C5 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jan 2018 02:53:44 +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 1eZ6WO-0003np-30; Wed, 10 Jan 2018 02:53:44 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eZ6WK-0003tt-57; Wed, 10 Jan 2018 02:53:43 +0000 Received: by mail-pl0-x243.google.com with SMTP id n13so6426358plp.11; Tue, 09 Jan 2018 18:53:39 -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=RCSlAsZHoVcbQ5U3Z1trhkoieXZMk3F+s4v3trZfVNQ=; b=gts38OehZSFomsogPeA0vHSxhXVC4L2LRRIoBQAk6mfQ3Ejs3tyFz6ZiSaSipXTQZX ChxoJiks1xBC7BlaF7hfwmUMFzrhG46VqQqoENhnG4+ibjeEYw5nAL3fAas/9mre29QZ nS/nNJg9bkYqUAm09lJspnllptLUi+IET1xsOU5uP1tpbfKRkmC/2tCDjVICQnn4RVD+ cUpXdgXGzJjcWWsy9yD0PHI+MO/Qqzs3GIvodW6e0grX3D1n16giLXuU8E5qwwUE8UcV MfpmSEs9FCBrqaKHOq2Qarv6dOUk0H3Qy/eUaQetR4GTAEvuukiZSWZp1AdRo4K9EF+9 D0jA== 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=RCSlAsZHoVcbQ5U3Z1trhkoieXZMk3F+s4v3trZfVNQ=; b=O+L/PqmhVYjtIOCj2tBcgyaJ7du1dOTgihzvf5FeH6TMCTtplkRPDiECV3M0gmYHCu uBIYVnhzJznimg0RaTA3Fbm72cE859wW9OZsEXpVw5VCAnJhU5XBYGIXd6tppRqus3Fx 6Ry5utwQ1ykC4CtLYlonadwdqjXBfTPn+EBCDA+HsL0VlkcJofwjyKx126yruZ1gxe19 UpbclFYI88YrApuxhFzlk77ytjxeoNYkoIrfVR7g83RzUd9XlbR0ixsDOAAZF+3UEvvX flv9SbPy9qzR2DExgwLIkCY71z6p7XHQvXht05yU+OIpKZT25dWhOVczols0GpLCemuZ AXDA== X-Gm-Message-State: AKGB3mJYcIiEaBjjQpgwA7YYpJ5jdfKhumI59BtRZGPT0D8GL9Jrq2vp JJpMFtoGwinVusaJlGGoEfQ= X-Google-Smtp-Source: ACJfBou5h8mI4t4keGh/cloetr20wLPjZ03GW8Ipe4zhcgqa/EnNylASGGuchKe0LffngiBe2NILoA== X-Received: by 10.84.247.1 with SMTP id n1mr17889240pll.304.1515552817397; Tue, 09 Jan 2018 18:53:37 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id t13sm16238547pfh.118.2018.01.09.18.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 18:53:35 -0800 (PST) Date: Wed, 10 Jan 2018 11:53:31 +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: <20180110025331.GE336@paquier.xyz> References: <48A02BB8-A7DE-4D11-9586-0BBE5E6FE4F3@amazon.com> <32F4B778-292B-41AF-891A-497B8127CD59@amazon.com> <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com> <20180109042720.GG76418@paquier.xyz> <4B232BD7-A97D-4461-81E6-28A49764B60E@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XuV1QlJbYrcVoo+x" Content-Disposition: inline In-Reply-To: <4B232BD7-A97D-4461-81E6-28A49764B60E@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --XuV1QlJbYrcVoo+x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 09, 2018 at 09:40:50PM +0000, Bossart, Nathan wrote: > On 1/8/18, 10:28 PM, "Michael Paquier" wrote: >> 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. >=20 > I understand what you are saying here. I think there are two competing > logging behaviors: >=20 > 1. If a relation is concurrently dropped, we should skip logging if > the relation was not specified in the original VACUUM/ANALYZE > command [0] > 2. If a relation is skipped because the lock is not available, we > should never skip logging At the end this comes back to if the relation is explicitely listed or not in the command specified by the user.. > What do you think? I will take a deeper look into how your suggested > approach might be achieved. Backpedalling a bit on this point and coming back to this message from Tom (https://www.postgresql.org/message-id/28748.1507071576%40sss.pgh.pa.us) which you just cited. Why do we actually need to issue any WARNING messages for unlisted relations? Contrary to what Sawada-san complained upthread, it looks sane to me to not log anything if a relation is not explicitely listed. So you should not get any warnings for a database-wide VACUUM if a relation is dropped while the thing is running, and what you proposed initially in https://www.postgresql.org/message-id/D3FC73E2-9B1A-4DB4-8180-55F57D116B4E@= amazon.com is more simple, does not need to worry about any kind of timing issues, and is consistent with autovacuum. -- Michael --XuV1QlJbYrcVoo+x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpVgCsACgkQnvQgOdby QH1jhRAAqDay1tj07xqWlfS5ztARHBTDQAJlNXY8KOZoopdMDNRTmsyouL+y/IEr Z+PEtThByTcxqybUNlQYhIUhYtL6nMIyvuHo8OEh4yF6kZnzWbbNXxlIUfKp9+Dy o6TdctmU+LltZdiws0MNYPkA7+xxK0lg8yrjzPA8JzQa0d8QmWH+Apl91v5c4uaO kziie4y5MGyxd4X+ZfFjQf2F1IQWfLBf4QoKhhSRFhknvw0pb4NHzrTrGTIkoZHf lgkC2sCljn5DAAAJYpj20swDTWyRS7KDAfwHJY4F11gT02w/o3NZn4Gb37yOpEaa KnQhM6pHb4BSZFKpGTzekOXnVNXVWJ+RDBFZSIoQrEiht8CZ5JAq/3v8/3jaX4ky qmoCI4aNhxZ+Ppry/9/+31HdtXBXsmq6jlYaTRVmu5SV1iibJ6U3hoeKPr/IyqcT XsKL/cLALDrKxugFUfFGboU5nfCiZfmos106izXw2L3u0ViI5RpdeqyQc9ZrwYhz SZL4yrXeQryU2B0oNqVfavvvdMhPUgfxVemwpcOgN/Y+qb451/0XdAOnVOIQq+0w 98UB7e/f0BnurOtVVNsNEzMS8GH96BIC99B2U23KotMsEma6wi2mA98Lbemg0WJA yTfxghTOxysi0ifPo9G7AHEUwzxwmrzm7OimjRvNIO9NDl7CtTw= =lPz6 -----END PGP SIGNATURE----- --XuV1QlJbYrcVoo+x--