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 1w4nrJ-002ZZu-2t for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 22:34:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4nrH-002oqu-0m for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 22:34:51 +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 1w4nrG-002oqm-34 for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 22:34:51 +0000 Received: from mail-vk1-xa2d.google.com ([2607:f8b0:4864:20::a2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4nrE-00000000m3o-2KLA for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 22:34:50 +0000 Received: by mail-vk1-xa2d.google.com with SMTP id 71dfb90a1353d-56ccdc3fe54so163774e0c.3 for ; Mon, 23 Mar 2026 15:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774305287; cv=none; d=google.com; s=arc-20240605; b=RGcHHHArXjTq2xIVBHFQxNIGo0JfEq/HEu2lIIFTEci3hzugHvaASbleW4KlXpSv0t Kp65Xvov6NWBX6PMRuUsl/+A+HrkW/WqPZgLTaaEr9CMGkPVjsxAHPtn0LaJnzr1ra+J SEaK9Kf6Po5O7gSiPaTl7S5CYoZFWBtoHqLweZK7ade6FKiVLZP9oHWUm3nS552dJZv7 vm6D1W5WbmlqRD/eb3sAyDyXDF9yLJXQ1mpKwin/OxEs+0QWrFdpRc0NzJ76Yciklo5h 5qgMk/ie9EJtnvx4XnhSR1xRFXhEaEUdNlUZWpHXGdjr9j74Tlp7SbhyP3H8oLaBHi7w Ef0Q== 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=ZFYVcnK9t0fy4HCVOZXvIRG03Xhd+hv/1s++ZHgla2k=; fh=hxFtt4elRXpM/MD8r19u7lXpFu5MHfb9gSY0k85wcVo=; b=eX/sbHNvFYreoPErj9Qu7Mm0AaicNYece85YmUnOKbFD/BMxbmhmOD5+BXctRtWVJ3 sZLv++Yr0F2hb+uDBQ58HOTM0AMd54s4jTq30KHIxO9UA4bvmQ+0fooYFHbCYG5bAZP8 CAS5jJJ6hwbvSbthSR9tOwL1DKtop4IgOYuUDq7wmXqvVabDtOtRaW4mbivD0OODhSWw AMoI68K+6G00Bo3CLRhOE0MiOsO6Vv9E+5TnwyU+a+OcH6IyYmII7i2d14o6MsadVT8A j4YOUV4//VON99WY//V2LdRusS0FPxQq/uGAJ7rQeB7gQxr29OzXWsDhMhUgC9g8EwmN QYow==; 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=upgrade.com; s=google; t=1774305287; x=1774910087; 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=ZFYVcnK9t0fy4HCVOZXvIRG03Xhd+hv/1s++ZHgla2k=; b=eYSl6fDwUZb0stPgFinSzmH869Ga/L2IQnipJZkD/ORRBN9l44eNEHWa2Z4+D85iQA cDC+eqAM75KvuRRC93WcEjo7StcdeC1JTzgCwYNvYbFVMDbWJSJdMAg7tqk/6zuEIDuV SAx84axK5nNKn5LHxddRXaY7xMRxr1Hph4Bh1DhcIDzDY7qCBDVFCP8+g3aFXShZgxpe aYEY0OaihKuRR845nKy+rQwJB2CwPBPtDZvT8T3EY/4AfuPXG+EvpMcjgiDVmV6HIs0o uC3nNRefTD6xpStTv+qARm/yVKg/QVGlgf5UL37p8glOgyDtt/YRze1tQraJWvbfhHC6 DuIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774305287; x=1774910087; 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=ZFYVcnK9t0fy4HCVOZXvIRG03Xhd+hv/1s++ZHgla2k=; b=frLiTe73hKr0Qb/d9KipuVBXwYpy9Zg2bnKTKwcqMoeM7AxG3dNy8DktK4VFRjdbwP NNr1gZzFzI6cX6AzVOy9U9e6TSlXTGAGX0TVfx1BYUC5u318x/bgLU1CpLgVPXWtaA7U +x7G1rt7gM5fc89bZi1+6ygJZl7MpuuZDOtoUBCILFnOv3rWCQzhJ1untarlWayrQilA /ppifXDivBzmPQZhuWfLAER4RldWj1VSsEkc8SmUe1ZCQX0bC2V2tdkxZZrVcjqBtGPg dybJKO0YzdNEFNnveRhmuxUsQSKWa4ZMc90h25wcMaOKkdr7vjwI4Tf1HAVTsyTXvRzI 55og== X-Forwarded-Encrypted: i=1; AJvYcCUkmVV3LFs/QNTOPWHhgzEVOn8nyJVuYZccsoKxyX7EJfqfoF2Z+v+kDDUP56ahTL0NLffyGPcV9Gs3Horb@lists.postgresql.org X-Gm-Message-State: AOJu0YwfWt+STj5FftUP+aCkZR/KrnBw917E5rPdv86cgzyj66tTRfGZ +uBVXos/xjI06ZL0F3HvOAFO6Q4nIs+Una9F3dR7fYwC7y+bOhqbROQ+SiqfTN/uKgzA/WnqxeF Y23k6+a6KE0Ll3wNGUws115v9QZmdKj4Xtrm52OsK4Q== X-Gm-Gg: ATEYQzwEANNC5lU/s1N49XORGKCjY6RP2O+G/q3HT+a0BG2DUxn1GmEZZvMo9ebljLu EQyPXyLz36gAh0OadkbEZufhuMLuTcgErRkGcPGGWlYonBq3RcVlJBpN6SE8gcj57pbpR2jQQR/ bgR4rdHzBdLilQzVcvmvo8g/yVZYKgIGP4hAqgK775zT4FeYTo9kdWmNfki34UJYk1ilah9L/J0 cfU1KTlAzwMsVWWGW6pYQSLbnVfVPMZJ5r1vOgfPFkD3DpQkaPH80OhmDmc7bdJG0IwcaE8dUbK wxou5/h6W44XuXVjKQ== X-Received: by 2002:ac5:cdec:0:b0:56c:c7ec:5e46 with SMTP id 71dfb90a1353d-56cde319f3emr3135215e0c.1.1774305287081; Mon, 23 Mar 2026 15:34:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jim Nasby Date: Mon, 23 Mar 2026 17:34:35 -0500 X-Gm-Features: AQROBzD-OKYBej_aKDIKemuq6uFFOsUT1ZUYo9FDB_sJ6qbpEKM23wewv6Xi1mk Message-ID: Subject: Re: Add GoAway protocol message for graceful but fast server shutdown/switchover To: Tomas Vondra Cc: Jelte Fennema-Nio , Zsolt Parragi , PostgreSQL Hackers , Dave Cramer , Jacob Champion , Heikki Linnakangas Content-Type: multipart/alternative; boundary="0000000000005c2977064db8a485" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005c2977064db8a485 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 20, 2026 at 2:20=E2=80=AFPM Tomas Vondra wrot= e: > * Does it make sense to tie this to smart shutdowns? I realize it's just > an example, and it probably makes sense to send the GoAway message > before a shutdown. But isn't this a bit similar to cancel/terminate of a > backend? Why not to have a pg_goaway_backend() function, that'd send the > message to a single backend? It might be useful for load-balancing, if > we could pick a "heavy" backend and ask it to reconnect / move to a > different replica. (Could that be handled by a middleware?) > +1. Another scenario that comes to mind is asking for a reconnect based on backend memory consumption, since there's a bunch of internal structures (relcache, etc) that can grow in an unbounded fashion. --0000000000005c2977064db8a485 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Mar 20, 2026 at 2:20=E2=80=AFPM T= omas Vondra <tomas@vondra.me> = wrote:
* Does it make sense to tie this to sma= rt shutdowns? I realize it's just
an example, and it probably makes sense to send the GoAway message
before a shutdown. But isn't this a bit similar to cancel/terminate of = a
backend? Why not to have a pg_goaway_backend() function, that'd send th= e
message to a single backend? It might be useful for load-balancing, if
we could pick a "heavy" backend and ask it to reconnect / move to= a
different replica. (Could that be handled by a middleware?)

+1. Another scenario that comes to mind is asking for = a reconnect based on backend memory consumption, since there's a bunch = of internal structures (relcache, etc) that can grow in an unbounded fashio= n.=C2=A0
--0000000000005c2977064db8a485--