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 1sdd99-00HAik-4g for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 22:04:11 +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 1sdd96-000SCO-Nd for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 22:04:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdd96-000S9z-CG for pgsql-hackers@lists.postgresql.org; Mon, 12 Aug 2024 22:04:08 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdd93-004QU1-9E for pgsql-hackers@postgresql.org; Mon, 12 Aug 2024 22:04:06 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-81f905eb19cso242054439f.3 for ; Mon, 12 Aug 2024 15:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723500244; x=1724105044; darn=postgresql.org; 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=ScpLIAUkzb+madbOSI3Lo+iF9H9Xt27s3wuSu9qJrTw=; b=fYSClCcpy1GAc99FTpDEqw+u0XjCL6NFPDCuYmOQlJZ+om8hjJYS9KXR+put7sUDa4 efzWXPBcLMr7wg/wEdQ+6BqbtxxKkMuDx+M3x7rV9Bo8zNHDZT+2vpvvE0f8JBYjig/E 2WXuwp6lInnoV6YOUqmoJH8pIOMsz7Ms0gyUOw6nLSNmMIaNHJM5smW3OXhmiNVAF8A8 XoRY6xpbx/gAduLLOFuPCOPnxdh/ucWop3rUH0PU+bIj4qsNGn0LspG0wfMAOdQiBa77 WV9xJIEpsJPGmI7tGKYNaQSjrAE4HgnJekj9lDqCEX9hzLK7i7NyBMYgkL8Sh3CT6a4R AwCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723500244; x=1724105044; 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=ScpLIAUkzb+madbOSI3Lo+iF9H9Xt27s3wuSu9qJrTw=; b=Ynkb0fz+T1+bufRE0qKEV7ZVMGBpSZIAsArDFYcBmIcLDPQQIV+11a1eq+iUQ79T/k jfxIsGayL/LF2cj/EkyzZl2H97SVKhwwnixDqfL7Q7zYgoDdfv9+RAAEjflUodK5Yele Pv67FdGefvta7aMNeZ66lHpf0ndAhzn3LUOfcrV/l/dBeKS7t3jhtLNHp5xoM/Dixe90 0loHoPRiQoAcze+K244r/oWFbjeFcfjE/1x1Ul3Y2Ucv/ECG6nFPzHyW5st+NymGeTAK dWP/lZ2MwuLfwk53MD2ukDcJXggNcxEKq/mmykBSwKW7APafU8CYLEccb1JrEB9ASxDb Laww== X-Forwarded-Encrypted: i=1; AJvYcCU2EznjNPmh6mHmUM5dsrWYtSMYJ9AYD+3WxTwWSh+BgV4110Ej1ZQhPuqdL8UolAnZCuQDeKCFyHjU+BHEvUlW/R/6yq62zjPYEWFQ X-Gm-Message-State: AOJu0YzoRiHr6gICDt6NcO1UXcP3whittVjGfd64U0+BdETbdRdue4Eg vVMsoAtgu8pJkyweqTXafzzc7vcOiB+Zw4+2/O4OLMfduOcq1GoX X-Google-Smtp-Source: AGHT+IE4unBoBDDR6oA4XFCL6E8tfm87leU+7S13s0ryYD50H+JOE5nnLcpi+DFglOLZMMy1fBFG4A== X-Received: by 2002:a05:6602:6016:b0:806:1b47:64ec with SMTP id ca18e2360f4ac-824c9aab24emr177759239f.16.1723500244371; Mon, 12 Aug 2024 15:04:04 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ca76a5de22sm1837618173.175.2024.08.12.15.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 15:04:04 -0700 (PDT) Date: Mon, 12 Aug 2024 17:04:02 -0500 From: Nathan Bossart To: Heikki Linnakangas Cc: "Imseih (AWS), Sami" , Bertrand Drouvot , Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Restart pg_usleep when interrupted Message-ID: References: <9D64CD7C-CA24-4FF4-9421-3A1A63F87DAC@gmail.com> <526E6A51-FE30-47C4-85C8-F2D18877607F@gmail.com> 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 Tue, Aug 13, 2024 at 12:04:28AM +0300, Heikki Linnakangas wrote: >> In the case of the patch being proposed by Bertrand, the number of >> interrupts > will be much more frequent as parallel workers would send a >> message > to the leader >> to update the vacuum delay counters every vacuum_delay_point call. > > Hmm, I wonder if that's a good design, if it results in a lot of interrupts. Skimming the last few messages of that thread [0], it looks like Bertrand is exploring ways to avoid so many interrupts. I guess the unavoidable question is whether this work is still worthwhile given that improvement. > On the patch itself: Making the sleeps in vacuum uninterruptible means that > vacuum will be more slow to respond to interrupts. If you SIGTERM a vacuum > process, or hit CTRL-C, you *would* want to exit the sleep ASAP. Since the delay will typically be pretty small (2 milliseconds by default for autovacuum), I'm assuming this won't ordinarily be noticeable. But I do think it is an important consideration. [0] https://commitfest.postgresql.org/49/5027/ -- nathan