Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t985b-007wMM-K5 for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 19:22:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t985Z-001YyO-0d for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 19:22:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t985Y-001YyG-On for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 19:22:41 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t985V-000its-Hq for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 19:22:40 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-7e6cbf6cd1dso936213a12.3 for ; Thu, 07 Nov 2024 11:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1731007356; x=1731612156; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=5HZDWUqbtlhNmK9iVQpAPsLHoZ73vCIeIO/1h25I5MY=; b=dMImB85YYTu+LSYz5aqdY92RnTnFKb5U55iwedPin84W+CHDB/txuDSscChJyoHUVI Fm3vQsXypIuLVEG6gMivnzJPoRuKl57oG2DSSd8meJyq9iP3kHMLThQmrTJKrgTTi4FF cxua5rBobbRy0xz7Jbkr7jIix93k9zCzTKhpQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731007356; x=1731612156; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5HZDWUqbtlhNmK9iVQpAPsLHoZ73vCIeIO/1h25I5MY=; b=SFX4ovcUbMYMUg7rD8XyxxLT4ktmmNWGkCJlRTrHwUm7YLP8yHcVYFKxe2kJrAplex 5Jebc9xAkUIjg6U+VTVvQcNOWiVw6kzdzoJMS+Y4Pia05gI+hZXBh4WfLyNM+rwsGmJP LqmGzrNwdJLtUMunzUfUV6hEFEnhHTikcLXQbl/W64ovp5qp+mhWTAV62xMhGoxy2F+R F8rfXywYpPIOYx9teGvws0gSViiyBEkVllo/aBfC41TMnAWc2iCGfIHNaworVmSES76D Hfh06mRjf9YgOcChkoZBKpOpK5Og+0jcy/6M93rsq6qZyrDmhXRpbJYpLoWdGRyZOGLd qfcw== X-Forwarded-Encrypted: i=1; AJvYcCWfB0RPMUsTWGjS9XpnVVjPNvQ2U8XlzJLLW42romJR8NHf1sQaraei/QetqHW+Vw1eDjlvR8BtXPr3@lists.postgresql.org X-Gm-Message-State: AOJu0YzHnQRvHdL2fDyMSwhQEOKD8MFZ24YWhMdHs3TrEEkONQB8yjmr xBruU3kfh3mooQWN94KifPezrviBQ5ElM0tJ9RiRhI+cEobhvOIHbFcELNIaQA== X-Google-Smtp-Source: AGHT+IElsusnbD71phjEvpdX/g3VdD9ZZIOGc3b6gbRKQgabT4P3uIA51mqELyijfdSfgBn6FSnvuw== X-Received: by 2002:a05:6a20:729a:b0:1db:dae1:22e5 with SMTP id adf61e73a8af0-1dc229b06a8mr144782637.20.1731007356213; Thu, 07 Nov 2024 11:22:36 -0800 (PST) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177dde20asm15939415ad.64.2024.11.07.11.22.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2024 11:22:35 -0800 (PST) Date: Thu, 7 Nov 2024 11:22:33 -0800 From: Noah Misch To: Tom Lane Cc: Francesco Degrassi , pgsql-bugs@lists.postgresql.org Subject: Re: Leader backend hang on IPC/ParallelFinish when LWLock held at parallel query start Message-ID: <20241107192233.94.nmisch@google.com> References: <20240918030159.2a.nmisch@google.com> <1737570.1726633422@sss.pgh.pa.us> <20240918050434.13.nmisch@google.com> <3441950.1730999841@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3441950.1730999841@sss.pgh.pa.us> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Nov 07, 2024 at 12:17:21PM -0500, Tom Lane wrote: > Noah Misch writes: > > On Wed, Sep 18, 2024 at 12:23:42AM -0400, Tom Lane wrote: > >> I do not have much faith in this patch. It assumes that the > >> condition "interrupts can be processed" is the same at plan time and > >> execution time. For plans extracted from the plan cache, there seems > >> little reason to assume that must be true. The proposed test case > >> cannot trigger that (today anyway) because SQL-language functions > >> don't deal in cached plans, but I suspect it could be broken with a > >> test case using a plpgsql function instead. > > > Good point. I missed that. > > While working on the release notes, I noticed that nothing further > got done about this concern. What do you think of adding a test > somewhere early in executor startup, to the effect of > > if (!INTERRUPTS_CAN_BE_PROCESSED()) > ereport(ERROR, > (errmsg("cannot start a query with interrupts disabled"))); > > It's definitely a band-aid, but it seems better than leaving > things at the status quo. That would fire in queries that don't error or hang today, so I think that would be worse than the status quo. This thread's previous commit just forced a serial plan. The executor counterpart would look like having the executor do what it does when there are no free worker slots.