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 1sdu3u-0023Tb-IZ for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Aug 2024 16:07:54 +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 1sdu3t-004zBf-0L for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Aug 2024 16:07:53 +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 1sdu3s-004zBX-MQ for pgsql-hackers@lists.postgresql.org; Tue, 13 Aug 2024 16:07:52 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdu3q-004fyv-5m for pgsql-hackers@postgresql.org; Tue, 13 Aug 2024 16:07:52 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7a1d3e93cceso603433885a.1 for ; Tue, 13 Aug 2024 09:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723565268; x=1724170068; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iQi4u3zk8PnKdVn52hmbE9Ho+uh3mJFvo5RW9OlLe0Q=; b=Y2SDpO4NTiw5OE24/kdl2OJbm20wu2I+ivh+0ERx9b4l0EV9B7W68+BjxDSJF452cG jUdHJy7itd5UiiW5ltpiS9ddJlbUpXtr2Y2/peGZN6Zh7kL3Qriu3SwqWdyDtGKOKcrs danlirBGjB5SoFlzggHozomJmSObIlec9X8jnXX9oRg/DQvHedtvcnaKPEJemx1nUOhh B8CACW3ztKVr+49cpvHWPjOaMmZPxhiVrLR/SaUD/TAd2ZtOgQjv4gKOn3PjsfFQ6c1j xvSqtERcVzMQTGPoCBrde9+/EQhJf2wMFhA0IEmeVuzl8q242q2JQstFhintPqFa5Lix ipKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723565268; x=1724170068; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iQi4u3zk8PnKdVn52hmbE9Ho+uh3mJFvo5RW9OlLe0Q=; b=BnCtj2OUgj9yWtjtY9+zlUndEHD31yG9D6UwXnzdk8SMeS8n2yDZ/qZ7c7WNyy2WZS 8e9PJjez8mfMp6f3Y5Npi3DqMZndq+whlcJZexWivMqx50QREptNziwt9ak1taIwUcVh YZrqTe3z6fd5Egt1NX6X+LsZ9ErEUUFybW/uIfzYBBGeATqIZVlLWtJGNXYhZa6pMOft X8u8WQSH0SkQaxcTzHSFhQxLT4HUOktN2r5qLYZPjGpdblLnCvBfsC+/DoEw3EuTYU/F k7GeA0TOqyIAzy0jkBR4NLfwVYYH7+m7NvjZwbPZ8RVxa4OUXxdqHT95Zexv294ZPo4+ e4ew== X-Forwarded-Encrypted: i=1; AJvYcCXEE5f7xMFDyab9SramOK6IprYc3ogHTFA2NqRY00mU7SzDVFnvb37of3nc5dN5R/9uodWmlF1yOKIQT7Xe@postgresql.org X-Gm-Message-State: AOJu0Yz8HbNMm24qNVnfgBx9FXri/KLwK8cd+bxuO/x4Hclt4LuyUM78 e7dmdXMCbvKVgYikIuXI0hRqaFXznZeeqXOgPSDPQAiJEiHCcnBI X-Google-Smtp-Source: AGHT+IHdl8AmAhbeMGeWGXiBw7c2DMgbHV4mIAcHulbf2PmtuaN7bAPpxELLEUB3SMYvhtbGIB2cNg== X-Received: by 2002:a05:620a:44c2:b0:79f:91d:a4c7 with SMTP id af79cd13be357-7a4e37e3827mr608809085a.15.1723565268196; Tue, 13 Aug 2024 09:07:48 -0700 (PDT) Received: from [10.81.2.40] ([15.248.6.116]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a4c7dedd20sm350302785a.88.2024.08.13.09.07.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Aug 2024 09:07:47 -0700 (PDT) Message-ID: Date: Tue, 13 Aug 2024 11:07:46 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Restart pg_usleep when interrupted To: Nathan Bossart Cc: Heikki Linnakangas , Bertrand Drouvot , Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" References: <2b5ac681-11d5-470d-af40-89ead9a868aa@gmail.com> <90ec1618-58db-46b3-8c9b-13616ac839a7@gmail.com> Content-Language: en-US From: "Imseih (AWS), Sami" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/13/24 10:57 AM, Nathan Bossart wrote: > On Tue, Aug 13, 2024 at 10:47:51AM -0500, Imseih (AWS), Sami wrote: >> On 8/13/24 10:09 AM, Nathan Bossart wrote: >>> On Mon, Aug 12, 2024 at 05:35:08PM -0500, Imseih (AWS), Sami wrote: >>>>> 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. >>>> The way the instrumentation in [0] dealt with interrupts was too complex, >>>> which is why it seemed better to handle the restart the remainder of the >>>> sleep in the sleep function >>> Can you elaborate on how it is too complex? >>> >> [0] made vacuum_delay_point more complex as it has to >> instrument cost_delay at an interval to reduce the number >> of interrupts to the leader. > Sure, but looking at the patch [0], it adds maybe an extra 10 lines of code > to limit the reports to 1 Hz. That doesn't strike me as too complex... > > [0] https://postgr.es/m/ZnlPZZZJCRu/8fka%40ip-10-97-1-34.eu-west-3.compute.internal Perhaps "complex" may not be the correct way to describe it. Having to add special handling to space out instrumentation directly in vacuum_delay_point seems very odd to me. I don't think vacuum_delay_point should have to worry about this. Also, 1/ what is an appropriate interval to collect these stats? 2/ What if there are other callers in the future that wish to instrument parallel vacuum workers? they will need to implement similar logic. Regards, Sami