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 1vkicz-001Gcf-1s for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jan 2026 12:57:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkicy-00DuY8-0M for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jan 2026 12:57:04 +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.96) (envelope-from ) id 1vkicx-00DuY0-2b for pgsql-hackers@lists.postgresql.org; Tue, 27 Jan 2026 12:57:04 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkicv-002ZAT-0g for pgsql-hackers@lists.postgresql.org; Tue, 27 Jan 2026 12:57:03 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-790992528f6so54196607b3.1 for ; Tue, 27 Jan 2026 04:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769518621; cv=none; d=google.com; s=arc-20240605; b=Ff7R0reodLVaEwod7+vtRImoLHcJUepo+DeWgDu9NSQ+Lwbb0EH1tRz3Nh2lv/zQej ip54J5gO6X/B6sca4d0E9XBrTx+O9ZcP/HuJqGPCn9H4Sq3ZZSqdJRT4Y3ZgiJjeDfZk 5mj9Ow11qP2IuUQrDTbWeKVK1zA6bMo+6hOMw2+lZP/Yqpz79TGRkQ4byiK1wEmDK5cO aeSzLWiw4hYPtvMihMO80zLUdE2ndgvj4jR5NwekSuOYNEZPb0dcHA3s9dyZwJogw4Gw Dpb0W58Z3Xr96MITMHfCwuVTlYseRTBcdc+wn5VtA4LUBI8n/5BJ9cIlAjpDMiSTrczX Itkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=j+qDTmXgF+nBBlEKKAh9OA704+ow0dEQOUE/pLO1Ux4=; fh=D+7prrSVFqR48zopjBsnsDGvH4Pca+00Vjc1mx+Ru4I=; b=DJxs0rpOqlnqq1Qt+RzUiQfEvnBDC+V1/D9NFpWHMHtybIO139g8fonzJnA8+sjJEx zwUFyvxUzqZ9XUBPLadp/6iv8CyonwucOjHZVAaauL579/RVuG2v5xJrMH9bXgUNjjrj AfRU0u9uo94Uq049VsB7LsN5bmDCNoBsAEIyk19OyOeIDMRnUYrRttHgZ5E7Pv8ZQ1TN R4POZ0PqDGknJuRdUnjsjMQmy0y5pf3fKgZ/G8CloRWHMg3anjsOpW35siRjTnQqDZoR s/hmC9/3TRX9/jQ3wgZ/k/9umkjSHCiv/O5l8lLmJgTsm2TQpB5u9ZTwIlul4yiyhM7v xtKQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1769518621; x=1770123421; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=j+qDTmXgF+nBBlEKKAh9OA704+ow0dEQOUE/pLO1Ux4=; b=SGuimRKxReEiFhA7mO73t+jIsw/b3bC4k8P9vJVOFKQ32tv5TVzoqgn33A4YBDsS7O kAjlS8KUqf+eIEoP1OZw+2vERBRi3E89qOvA+bqbNpeg9GvDQTZ1DtH5/t7gFrQUg5IK R7QI6h/tGfPQz1K3VPZSkwiDj5JtQTKAQ5I5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769518621; x=1770123421; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=j+qDTmXgF+nBBlEKKAh9OA704+ow0dEQOUE/pLO1Ux4=; b=qPF5jLG8/DkrPJng8b9s2MSA7JG+2GyKdAOUNRAAd9g76gbfB/dms9N2FODMy9eWGm 5jp8GQp1eN3XAAFy67kxVMwqPWeYqp11WiAzTQtCWYxdanMSSwl1AJo6g4lqsDF3nOUI fSyGJLhoAlVR/bPs90AVLji7yoesdaKy00+1Wqn9MMVQaXcC72g3ZUUTLPnr1Oui2oAc hBjq8gV6J7tZhDGIkzuqcf5Pgnepqg9m1KVElBwALQXr0DModeIVjTdtGaoArUujgEf2 CN/7ZWIB0r0iNwKmfPAoTNt9sfuYGmFHropyySAsTajuX2L1Bmv1jKOAWsB0s6ieSGJy GEHw== X-Forwarded-Encrypted: i=1; AJvYcCWKZr5JxQ3JfNPWyv3ZRAqAtOYpntzHeJkhrZQCMT3MV4bL99gJ7mFLfdJE2aeZZzwRVi93cJ6qlq4bbxx6@lists.postgresql.org X-Gm-Message-State: AOJu0Yx/GbSGZAcxZk3WCwxBRWCXtj/ozscan+Z4v8g4sgnJseZNEaWe epGgDic7kH13mOcqClRhWXeonMMryV18IV6n1A0Mm8flQprWjjMBxhCz6YyN0oNZfuANLmUvkFG o6q9QaDQjdhpvw7K3oX/Vb70ISgIioHdNbpp0a2KxPxPEoVNd3IcVZfy5y5X4+GYu1BpbsJ3mWy kfqNnT1DX0FJdS+JT9BeUvO4ub4pERtdAs5+MnIQpF48lb4yrBKwRIuwpdAeCC8vnMfICVVMYZR ovnJkeGThqwbK6KuGC7LHZrdcyotCZSm0S39BqdkiKrK2lyIjYGZ+/0MyCYwsWfoOE= X-Gm-Gg: AZuq6aKGKlxz0l50gc1arYa5ZyTl39yjb6DbrWaFmyLfYfVufHruhD7ccP5Nq+S/dSa 82YwELPdM/YvUvLaukOAVDqcXXQqW7cbFGf5a4nVqyvXG/QBXriXBqC1LcC/oXFQKiDKoOXcBbj Pu3Gu4t1HOyyrYFAUInl4ZxDa1hqI8OUEmbsvlRiMoMgoK8uaKJztjGKQKtRGLSz1dvJyf5jay0 Dkne2G+X8lDzXZWiWVf6kqID9lN0CActp1wEYz/cdWkHNcUVnR/rzbJoXr/PntsG1vsnshZaiOa +Vcjq5Ox5M0r+s+gZtpY/IwobPiADT8rVO/6KJyC3KZe6nqXhGUFOLeHXLChrFH3bIQ= X-Received: by 2002:a05:690c:7288:b0:793:af69:83ae with SMTP id 00721157ae682-7947a9ec99bmr10530657b3.14.1769518621072; Tue, 27 Jan 2026 04:57:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zsolt Parragi Date: Tue, 27 Jan 2026 12:56:50 +0000 X-Gm-Features: AZwV_QiKXzeoR6klR4vBG3EQEXHzGAquC_6TbXKnudC_guL8XDjg9jcttqcwB0w Message-ID: Subject: Re: Add GoAway protocol message for graceful but fast server shutdown/switchover To: Jelte Fennema-Nio Cc: Jelte Fennema-Nio , PostgreSQL Hackers , Dave Cramer , Jacob Champion , Heikki Linnakangas Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! I only have a few stylistic comments and one question about the wal sender part - but maybe I don't understand something there. + /* + * Only signal regular backends and walsenders. Skip + * auxiliary processes and dead-end backends. + */ + if (bp->bkend_type == B_BACKEND || + bp->bkend_type == B_WAL_SENDER) + { + SendProcSignal(bp->pid, PROCSIG_SMART_SHUTDOWN, + INVALID_PROC_NUMBER); I don't see related changes in walsenders, am I missing something, shouldn't this have some handling in WalSndLoop? Also, shouldn't walsenders exit later, after normal backends have already stopped? So I'm not sure how this is supposed to improve them. + /* + * Parse any available data to see if a GoAway message has arrived. + */ + pqParseInput3(conn); This is just stylistic, but other places seem to call parseInput instead. There are also two typos/mistakes in the documentation: * "rquest" * "server requests the server"