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 1qE9tb-0004no-2u for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2023 14:42:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qE9tZ-00014r-Fh for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2023 14:42:17 +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 1qE9tZ-00014h-2T for pgsql-hackers@lists.postgresql.org; Tue, 27 Jun 2023 14:42:17 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qE9tR-000nQC-Fe for pgsql-hackers@postgresql.org; Tue, 27 Jun 2023 14:42:16 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1b0605d4d11so619750fac.1 for ; Tue, 27 Jun 2023 07:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1687876927; x=1690468927; h=in-reply-to:references:message-id:to:subject:cc:from:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=c9NsGzcpmCg0MOsl96TrUXxj362ontULSgJdQG8gFYU=; b=X2plUeItz8aw66Uc+DRH8tazqCZ7H21Bxwt8Bo9C7y/P8mRORM/ODHNMuAc0AiBj3+ cnMW1hRVvZn/DvulHxFUGbjMCGm3rWfzgUyWjkZ01/uDcDAS6Zj3wlhZTIgfUBzkGQI8 RgbRXb2MNb4YKxxrdRq6d1UWh2NS0eXEuUR9vGN1AGk7LDhe/q845QaJM92H2LLT/i79 37RywE0UGWw7r5qJuSU9ZwvzudNcO5RsRVKvFuf0NVvbwASYKdq57D1x9u6ZhPQz0vAt WaEsfr57QEi+7XD2hKbvc2ctrsrXZAhyHQPxSOiW5bWk2JIFHYxAucYib217zKR+zNd3 BQxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687876927; x=1690468927; h=in-reply-to:references:message-id:to:subject:cc:from:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=c9NsGzcpmCg0MOsl96TrUXxj362ontULSgJdQG8gFYU=; b=a7cat+MXmhgVMmuZJcGZbpdcFByiE3tSSnkMkFE2MVHJoEbmNzJ8eOO6VnK5eJ8CwC V3X4YBaPLLF8uVY3k0lSV3mbdswRvQzKwL0Xn8hfnXVZGAchVGRKcM/Sk672Kx2+uoyg O/b3XsB7/qvd/o3DJbvvnS1tXgLPwl24JICVx3mFVyfmd+0skALJAcWla997qgFgKDjF 1JDiQum071hackAv6Qisx8PQsqcJSw0KAxTnvOUgEf76i5j531Wc2slmGscwj64CJ/RD uDrqvii6YFv8UEMrfSNz06/IYEeH/aa053yXAE6pvHSfbAGGQf7AA5Z2W/kITXtsPJG3 NCjQ== X-Gm-Message-State: AC+VfDx3sAguqql0e0GJm4exNhKkN1lA4Kfa/OaVZUS+kHnVpSpwDkCJ kFjNuBE8G+E+fLQGD4Gg3WvafqbkZaaHbwjJqU3vUg== X-Google-Smtp-Source: ACHHUZ51um4Z+YaZHVd+tWAIy1NF5k2Mjm/M4zvaR9c7e6qcgGAuJ78/HKDDnOW98ojbW49JzfJ/Hw== X-Received: by 2002:a05:6871:6ba3:b0:19f:2257:6865 with SMTP id zh35-20020a0568716ba300b0019f22576865mr27291690oab.31.1687876926741; Tue, 27 Jun 2023 07:42:06 -0700 (PDT) Received: from localhost ([2607:fb90:e62b:4f29:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id f39-20020a056871072700b001a69e7efd13sm5194250oap.5.2023.06.27.07.42.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Jun 2023 07:42:06 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 27 Jun 2023 09:42:05 -0500 From: "Tristan Partin" Cc: Subject: Re: Make pgbench exit on SIGINT more reliably To: "Michael Paquier" , "Yugo NAGATA" Message-Id: X-Mailer: aerc 0.15.2-74-gdfabb5232875 References: <20230619223937.209ff5c4c295da2fbb4adaa0@sraoss.co.jp> <20230622145814.0bbb4b8503eb5147e55ef05a@sraoss.co.jp> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu Jun 22, 2023 at 6:19 PM CDT, Michael Paquier wrote: > On Thu, Jun 22, 2023 at 02:58:14PM +0900, Yugo NAGATA wrote: > > On Mon, 19 Jun 2023 16:49:05 -0700 > > "Tristan Partin" wrote: > >> On Mon Jun 19, 2023 at 6:39 AM PDT, Yugo NAGATA wrote: > >>> [1] https://www.postgresql.org/message-id/flat/CSTU5P82ONZ1.19XFUGHMX= HBRY%40c3po > >>=20 > >> The other patch does not replace this one. They are entirely separate. > >=20 > > After applying the other patch, CancelRequested would be checked enough= frequently > > even during initialization of pgbench_branches and pgbench_tellers, and= it will > > allow the initialization step to be cancelled immediately even if the s= cale factor > > is high. So, is it unnecessary to modify setup_cancel_handler anyway? > >=20 > > I think it would be still nice to introduce a new exit code for query c= ancel separately. > > I have the same impression as Nagata-san while going again through > the proposal of this thread. COPY is more responsive to > interruptions, and is always going to have a much better performance=20 > than individual or multi-value INSERTs for the bulk-loading of data, > so we could just move on with what's proposed on the other thread and > solve the problem of this thread on top of improving the loading > performance. > > What are the benefits we gain with the proposal of this thread once we > switch to COPY as method for the client-side data generation? If > the argument is to be able switch to a different error code on > cancellations for pgbench, that sounds a bit thin to me versus the > argument of keeping the cancellation callback path as simple as > possible. I would say there probably isn't much benefit if you think the polling for CancelRequested is fine. Looking at the other patch, I think it might be simple to add an exit code for SIGINT. But I think it might be best to do it after that patch is merged. I added the other patch to the commitfest for July. Holding off on this one. --=20 Tristan Partin Neon (https://neon.tech)