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.96) (envelope-from ) id 1wzdCb-0048Au-0W for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 16:43:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzdCa-003KjA-0W for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 16:43:44 +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.96) (envelope-from ) id 1wzdCZ-003Kj2-2m for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 16:43:43 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wzdCX-00000001a6X-1TfI for pgsql-hackers@postgresql.org; Thu, 27 Aug 2026 16:43:43 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-938cd95b06eso79568685a.1 for ; Thu, 27 Aug 2026 09:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787849020; x=1788453820; darn=postgresql.org; h=content-disposition:content-type:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iwJcTY6Wgq0lhIuscK4Z6k1Dl5+oCmUmvsUcD4urDUo=; b=rpsw+7BWPcKdNSIq/aU08t1Wat8sR1q27fGZEY6TVxHVgT5CbSYcZytytSAXJbpw2Z bP1tIbe0VVtc7poFIbQe6ynbYxLGxR2AlylO3MAfYK0FrODcQ9pI+HeqEafuptL6sbyo uWHmWhit4loxQEPHdxgq3x6UiIyT+9LBCvtsC/HL/KIMLVKpCfA0VIVkVQJxidLYTKf8 XGaZG1FaoWwEO5NRAr8UkR4nv3Mo3gZfDiZX7cHypEQ9VykfUzxt0eqZJEJrXoAKAFAy wKaMZ2Xzrr4feYG/2i1Q5Owi0E/y/aabS/CGiEQzK9j/lPkIIKwr70DbQRdF5d9MV2jm Ld6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787849020; x=1788453820; h=content-disposition:content-type:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iwJcTY6Wgq0lhIuscK4Z6k1Dl5+oCmUmvsUcD4urDUo=; b=lOlRvxAgpwtnbjpnnCuDj3a4OyXb6bGP/Zlter7JWqkAjGtWr9JqA/pl5QbLhRa+MU MRskxkwQLNucXeCi9Zmrvi1DBCuCVm3+ES9UmLWkII5EZPInwextnGah/+4upGiG6qVg TPZ5fUUFcQMND/f/rVwSMZm//nkJgC5XgRJVrzGTg0njJ495HePoDcgoV++8uEOuwRBw W0io1LiEDuN7pfTOVrRFJEazpQXzoroPKPm1pJNyZ29tGu9A7Yq8nPtbgEdFVPHUdYHL Wic5AvEyq8jW2atYj/7vi+WmQ2JukM+376zysDV3bkGqR0cFi7fy3AG5Ix22rs72hM9f 42ZA== X-Gm-Message-State: AFuF++n4gxQsmiGO3NL2SU/3lRj5V3bmWQR96VXoIHpg5Cxwv03c1b+q awlbJ1j848DqQjind93hT9vaSUW4qCQ4ikF9xvm6JTkxHdMtZqmKqx2asXAkQg== X-Gm-Gg: AR+sD13QRmNVfRDEC5bNJDN8JbC8vbWlEA+m6pS10E+ErSaPzKCqu37MagEzxu4LiGD 8ol0StdGz7QSxpGhhTRwWbeoZfrr7grYxuYT4mSHAAkNMUvZPMAHeP2Y6CbtiAhAtGAah5XwEfA B4eVp6yRwylk/JrUaS+USu/U5nJIXXDJmHfUIvE8Ge8SjymkaTJrSPrD0C/pVhhqtKG90dTaXLS 4Fp/JFU5Q6GCzS52E5mcfOld+Tr1Tb4ZGDNwFeiaBca68MT1J/9zjloa4pUh4CAug4e5hIMNDL3 FH9MXoh/z0oiNADiqFn3dkuEiYHp4ndEIuzj9ie25tNsHCXvybbTz3SGUGeXyUEpwTD+GnoqjkR CHxQtcgJgH7Do8olZgVNiRymhYwjM12CVPSu7MPJ+vfQqVJKJhnnn0MXdzysPKlqU0q4Qezra8T RI9Zf6K10Bc1QhFXVnirBGSLhMNPMTCuiCH0irU4qkts5FNBrNrVlBz8c53sSRkMiIX29eRTz+O pbwf44ppDT6rBxvIb89icHxjOF4BSobZdw1Ex9rtuE5Owu9e2+9eQPmHuq3jnpPGkTX13mwSJwv sFiI3DaJxKByvlk= X-Received: by 2002:a05:620a:6503:b0:936:e84a:b983 with SMTP id af79cd13be357-939126cd065mr82859585a.6.1787849019501; Thu, 27 Aug 2026 09:43:39 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9391370b1bcsm853885a.4.2026.08.27.09.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2026 09:43:39 -0700 (PDT) Date: Thu, 27 Aug 2026 11:43:37 -0500 From: Nathan Bossart To: pgsql-hackers@postgresql.org Cc: alvherre@kurilemu.de Subject: REPACK decoding worker startup/teardown differs from parallel.c Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I don't know for sure whether either of these are v19 material, but they seemed important to at least note: The startup wait only checks shared->initialized, and the error queue is attached with a NULL BackgroundWorkerHandle, so a worker that dies before it attaches leaves the leader waiting indefinitely, holding ShareUpdateExclusive. Mihail brought this up in February [0], but it doesn't seem to have been addressed. parallel.c attaches the same way, but then calls shm_mq_set_handle() once the worker is registered, so the queue knows which process it's waiting on and can tell us when that process is gone. IIUC this issue can only happen when fork() fails. For teardown, we wait for the worker to exit under HOLD_INTERRUPTS and only then detach the error queue. A worker blocked writing into a full queue waits for the leader to read from it, while the leader is waiting for the worker to exit, so nobody moves. DestroyParallelContext() detaches first to avoid this. I'm not sure if this is reachable in practice. [0] https://postgr.es/m/CADzfLwXJLypkRdpwapQr%2BpZQnv1-NvkJ9DpzWhNwudQgirCE0Q%40mail.gmail.com -- nathan