Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2FNN-0000yD-99 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Dec 2022 17:35:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2FNM-0004DH-33 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Dec 2022 17:35:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2FNL-0004D7-OV for pgsql-hackers@lists.postgresql.org; Mon, 05 Dec 2022 17:35:31 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2FNI-0005Wd-Tw for pgsql-hackers@postgresql.org; Mon, 05 Dec 2022 17:35:31 +0000 Received: by mail-pf1-x431.google.com with SMTP id t18so1739049pfq.13 for ; Mon, 05 Dec 2022 09:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=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=YmZzzGFomtdl8DEMn09OKt2PGoPgjFXTcAw0TziXvFI=; b=ggIDzNerv/9rBAH4ThJSrBI3uiXbH68L0fDJ8prget17+c4CGlU0gpgNKPltwzUPTW BQvrQslzmC4DVxs51ag9L6RllMuffMNuxnT82ymdZcLYqyiNEKj2EgReyR/Q1JsfbqM4 Ca21C4xM8YrfWTKnZYROFgCOUVk9dMSK2H/zgjWG6H1UdeQ+ZOOtitFKbd2n9LAiKLeA 4bbIU4XVUf6z6PEkEGyo2QZeMrTBVzcl8R7DxX8zGFFFN/OSxvdpQc1Jir26VWAJ5Ut4 gYRpxz9QSb1Di/1XDEZrVlSDgH+PSYlo9vkfyEH1ah5iZR/1LCTW6gRl2z5ErNifNtkP GBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=YmZzzGFomtdl8DEMn09OKt2PGoPgjFXTcAw0TziXvFI=; b=akYZg8+qRFzeBKnB6MFcIQjOM1N9BYSVwlQIQahYg09arGHZZxZvkBcha6laoOdfiS Uk7l1qPw2pC+wkvATJeJFBfxt4sQQObSnmioN8mKewVDwJFRxi0/F6KP7SXfKgSe/HBR pkXIMzlaIWHZlrVudLQJI2JqmsRkxHVU2Bx/wK37ZoRw3biFAINAU4CEa4VPxKUQjIHq 8tWNiuMI9rVa9nkJQQOC1Rl1fBWVQ7v3nGHqMJT5xcKsO0EK9Af0Oy5NmdIEIIzvIP1Y D4SCM1zbsR/ZakOLnkCjbhEK+TzRiu/ezxhScDioly6yjucm7D8ZMSS4VwH8rrM4BBLr n4DA== X-Gm-Message-State: ANoB5pn1zhYQhEZpTuaxEcdTV3+7KUWv9LVm0j2P+T1GCbSWZe8kjSsl WgWmHYUSNUXbFFuruxw/1as= X-Google-Smtp-Source: AA0mqf6+rDp6i0PmPA0JVgKNQlDhT9zI2jwhdQQvH1Ed/1Pkn0f3zU8kEKvqg5WDP22Irn00vrIJ+A== X-Received: by 2002:a62:198d:0:b0:572:5a7f:9f4a with SMTP id 135-20020a62198d000000b005725a7f9f4amr65207134pfz.33.1670261726612; Mon, 05 Dec 2022 09:35:26 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id y2-20020a17090264c200b00189348ab156sm3865472pli.283.2022.12.05.09.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 09:35:25 -0800 (PST) Date: Mon, 5 Dec 2022 09:35:23 -0800 From: Nathan Bossart To: "Hayato Kuroda (Fujitsu)" Cc: "pgsql-hackers@postgresql.org" Subject: Re: suppressing useless wakeups in logical/worker.c Message-ID: <20221205173523.GA2714833@nathanxps13> References: <20221202195503.GD2277157@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 05, 2022 at 01:00:19PM +0000, Hayato Kuroda (Fujitsu) wrote: > But in your patch, the apply worker calcurates wakeup[LRW_WAKEUP_PING] and > wakeup[LRW_WAKEUP_TERMINATE] again when it gets SIGHUP, so the worker never sends > ping with requestReply = true, and never exits due to the timeout. This is the case for the walreceiver patch, too. If a SIGHUP arrives just before we are due to ping the server, the ping wakeup time will be pushed back. To me, this seems unlikely to cause any issues in practice unless the server is being constantly SIGHUP'd. If we wanted to fix this, we'd probably need to recompute the wakeup times using the values currently set. I haven't looked into this too closely, but it doesn't sound tremendously difficult. Thoughts? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com