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 1r96QI-00EBtz-6T for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Dec 2023 16:31:26 +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 1r96QG-008Pmx-Tp for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Dec 2023 16:31:24 +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 1r96QG-008Pmo-KB for pgsql-hackers@lists.postgresql.org; Fri, 01 Dec 2023 16:31:24 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r96QE-008Ieo-0L for pgsql-hackers@postgresql.org; Fri, 01 Dec 2023 16:31:23 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b8412723c4so438951b6e.0 for ; Fri, 01 Dec 2023 08:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon.tech; s=google; t=1701448281; x=1702053081; darn=postgresql.org; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gs0qV79RRPx6F9ndHAn5ELrekp0awWKT/i2cfrpVw0c=; b=pU5j9j3JsgHj8LTP20RVOZP7PnQY8WanLH//PFkFi7O/vXt4TjI20hktOhKQCB2dQp R/aYShbLhSw0s8oiydiU5OS3ldSyYBEZy0nNNFLlZiWmPDrRh05qH8EFrheaHuM4evwd MkdDnu/0oIj6cxm7O7KQJCThfFcGnZuq6BnrU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701448281; x=1702053081; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gs0qV79RRPx6F9ndHAn5ELrekp0awWKT/i2cfrpVw0c=; b=a0F1/W6Isf3KGamatD+A7nU4JW+o+GG0aI7ytJmPfFwrEtR0zKnYk9sq4gk67oUSOE sLk3RvigHoDjEA5y+FrtWI4Ye6+8E9Mc+3idDE4wVW1XgsI5agbp171RAQntcNGyDWdb CePsUpizGcz7/Aq6pRvabd+TsFDhGUniLPWXIR35X4f8VHq+1VAE2wi9FnwYNM2I58Ef /20Rc3+lXf3/nbroqKs4vGM+GsjBccQiUGWxROO33L5w7Aj0u+1u+z3g5coLUwKZwXJx LDxjkY6nP0E7Ze+Su6F62BVKc9hvFFogWMnJxOTt6jq9jtelm5jbkl25DvmbGWPBb6uy 8lgw== X-Gm-Message-State: AOJu0YzZ6QI41vKRljCkhFITdfVTu8rZYIke5rmr8NCw/1YQ2Nv8pKE0 PPFmABNsUjESUbIdGOjklth+wg== X-Google-Smtp-Source: AGHT+IFFuUJ11r2/ke3pb91hzPhQtr/cFgX27WsaABTguZ4ccV8T+1tul9XrHnB6+LS2si4w7Bgm7g== X-Received: by 2002:a05:6808:1710:b0:3b2:df82:812e with SMTP id bc16-20020a056808171000b003b2df82812emr4146704oib.32.1701448281440; Fri, 01 Dec 2023 08:31:21 -0800 (PST) Received: from localhost ([2607:fb91:128d:c7a0:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id t3-20020a056808158300b003b3ec15d8ebsm603421oiw.5.2023.12.01.08.31.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Dec 2023 08:31:21 -0800 (PST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Fri, 01 Dec 2023 10:31:19 -0600 Message-Id: Cc: "pgsql-hackers" , "Thomas Munro" Subject: Re: Refactoring backend fork+exec code To: "Heikki Linnakangas" , "Andres Freund" From: "Tristan Partin" X-Mailer: aerc 0.16.0-85-g0be135a38186 References: <7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi> <20230710225043.svl7fqxecwshwc7a@awork3.anarazel.de> <119551e6-60f6-49b2-ae04-a382a89f900c@iki.fi> <3b02a5a1-81ea-44e4-a09e-c0a594a4cef8@iki.fi> In-Reply-To: <3b02a5a1-81ea-44e4-a09e-c0a594a4cef8@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri Dec 1, 2023 at 6:10 AM CST, Heikki Linnakangas wrote: > On 30/11/2023 20:44, Tristan Partin wrote: > > Patches 1-3 seem committable as-is. > > Thanks for the review! I'm focusing on patches 1-3 now, and will come=20 > back to the rest after committing 1-3. > > There was one test failure with EXEC_BACKEND from patch 2, in=20 > 'test_shm_mq'. In restore_backend_variables() I checked if 'bgw_name' is= =20 > empty to decide if the BackgroundWorker struct is filled in or not, but= =20 > it turns out that 'test_shm_mq' doesn't fill in bgw_name. It probably=20 > should, I think that's an oversight in 'test_shm_mq', but that's a=20 > separate issue. > > I did some more refactoring of patch 2, to fix that and to improve it in= =20 > general. The BackgroundWorker struct is now passed through the=20 > fork-related functions similarly to the Port struct. That seems more=20 > consistent. > > Attached is new version of these patches. For easier review, I made the= =20 > new refactorings compared in a new commit 0003. I will squash that=20 > before pushing, but this makes it easier to see what changed. > > Barring any new feedback or issues, I will commit these. My only thought is that perhaps has_bg_worker is a better name than=20 has_worker, but I agree that having a flag is better than checking=20 bgw_name. --=20 Tristan Partin Neon (https://neon.tech)