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.92) (envelope-from ) id 1jI0N5-0008Ct-0S for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Mar 2020 01:34:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jI0N3-0007Ss-IC for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Mar 2020 01:34:45 +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 1jI0N3-0007Sl-5Z for pgsql-hackers@lists.postgresql.org; Sat, 28 Mar 2020 01:34:45 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jI0Mw-00041Q-Gt for pgsql-hackers@postgresql.org; Sat, 28 Mar 2020 01:34:43 +0000 Received: by mail-qk1-x730.google.com with SMTP id b62so12977324qkf.6 for ; Fri, 27 Mar 2020 18:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1davE1yGd2ifCwzHaZX54YoHqjKvSgBMdRoTpnKC28k=; b=i9lhCF4ejlXL16iq2MpBk4bE3wKeyZY7ff9OnhOeWLrrqck2h8ZPyHhPmqF7XhRIAB FRoz6xeObpKtlDlqEqPGTUH9c0kBvoCPVPC3pG9DimBAKbAKkUUYpGDq3D4TyqzKHAIg r+4RcmjKYQhOGEJH9jJVFSvPgjABAoTr/M1in46VWb+wkwFB/SRnrE+qrkBt/ouBVfwy E1je/1Tzdo+DlVuBC+BTGL5kF0mo3fR0zEmuZzdyFIQgyT6IksjfH5R9vkyCptietjwP ul5QfgWlp+V+AdvYLLkeUcK+55mnIpe+VIWuu2jego7XwWXQbEnuafnY10otKmjWEefZ wqnw== 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:user-agent; bh=1davE1yGd2ifCwzHaZX54YoHqjKvSgBMdRoTpnKC28k=; b=C6bj4wqkDJknnzoWBPeTIuHjvu+Xs87JMQzNzi4e5dzGqo6KVYIReIQekAXDpM4dV2 x9HXgQUL3cDkjfIohsuCocTx5INn7dyApp8mt0L91PRZCpKKA/aZLHI0nMa0WSqfj3Vl wAV2FCHZPa2zHjrL1DJ56mLzx97VCKAhgrNblL/OoH9Ih5GnW9cz9bBL4BcDJjxYHcp/ Fwm8zCgQGFbVI/1us6Lb+0NaZA8jW0qzM+O5CyrWiktWnWK5WW8yEWnoZtKKLmZBv+xW 73tj7E7vhKY0QiU10jDzJtEqY3pv6VN7LRvncNUiUfiDABpuFRumV2qEj3HkiWhaj4kp FNNA== X-Gm-Message-State: ANhLgQ2o+32UH9HkKKWzZRqnmgxIP2KFRSKgDhDOEMy3lGtghanGK8BT IKGz3DXCqW9krlksalOUCz+45w== X-Google-Smtp-Source: ADFU+vtu2ZB0o8l4JvDqqnhHVc/DPAx8iJ330D8InltgolaIuOty30hlCh/lsVTewmr2g0s5yIMHaw== X-Received: by 2002:a37:9ec8:: with SMTP id h191mr2178608qke.260.1585359277379; Fri, 27 Mar 2020 18:34:37 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id p191sm4980231qke.6.2020.03.27.18.34.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2020 18:34:36 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 0D311800926; Fri, 27 Mar 2020 20:34:34 -0500 (CDT) Date: Fri, 27 Mar 2020 20:34:34 -0500 From: Justin Pryzby To: Amit Kapila Cc: Masahiko Sawada , Alvaro Herrera , Andres Freund , Michael Paquier , pgsql-hackers Subject: Re: error context for vacuum to include block number Message-ID: <20200328013434.GZ20103@telsasoft.com> References: <20200326150457.GB17431@telsasoft.com> <20200326221752.GR17431@telsasoft.com> <20200327044424.GD20103@telsasoft.com> <20200327061601.GE20103@telsasoft.com> <20200327190428.GS20103@telsasoft.com> <20200328011632.GY20103@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Mar 28, 2020 at 06:59:10AM +0530, Amit Kapila wrote: > On Sat, Mar 28, 2020 at 6:46 AM Justin Pryzby wrote: > > > > On Sat, Mar 28, 2020 at 06:28:38AM +0530, Amit Kapila wrote: > > > > Hm, but I caused a crash *without* adding CHECK_FOR_INTERRUPTS, just > > > > kill+sleep. The kill() could come from running pg_cancel_backend(). And the > > > > sleep() just encourages a context switch, which can happen at any time. > > > > > > pg_sleep internally uses CHECK_FOR_INTERRUPTS() due to which it would > > > have accepted the signal sent via pg_cancel_backend(). Can you try > > > your scenario by temporarily removing CHECK_FOR_INTERRUPTS from > > > pg_sleep() or maybe better by using OS Sleep call? > > > > Ah, that explains it. Right, I'm not able to induce a crash with usleep(). > > > > Do you want me to resend a patch without that change ? I feel like continuing > > to trade patches is more likely to introduce new errors or lose someone else's > > changes than to make much progress. The patch has been through enough > > iterations and it's very easy to miss an issue if I try to eyeball it. > > I can do it but we have to agree on the other two points (a) I still > feel that switching to the truncate phase should be done at the place > from where we are calling lazy_truncate_heap and (b) > lazy_cleanup_index should switch back the error phase after calling > index_vacuum_cleanup. I have explained my reasoning for these points > a few emails back. I have no objection to either. It was intuitive to me to do it how I originally wrote it but I'm not wedded to it. -- Justin