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 1sdcfS-00H7T9-6v for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 21:33:30 +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 1sdcfQ-000L2V-RW for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 21:33:28 +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.94.2) (envelope-from ) id 1sdcfQ-000L2N-Hi for pgsql-hackers@lists.postgresql.org; Mon, 12 Aug 2024 21:33:28 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdcfM-004X0n-IQ for pgsql-hackers@lists.postgresql.org; Mon, 12 Aug 2024 21:33:27 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ef298ff716so7610901fa.1 for ; Mon, 12 Aug 2024 14:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723498403; x=1724103203; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mWrLCokxS0NRWFwWq6GAU7ooSoM/6W76Lkh+xM5Kh1k=; b=QwJMgnsxmWsx9VkeE3jsNGgrYGTfpY3kqDlW0keADYXzOOgAwDavN5GFeh+wq7CHYi hgHVFenqNLveTf3gYfTJYhTp3haUbBQ8MN6V62sLyUmxJwqqd+59enoGNw5oU300zVFF Lsw6zc53vcpASguMN0fjxlQP88sBQnMUPCDrz1fIZKB2QDFW0xmWamTNnPm5RZ19YblA YNKMIPVC/w+0kPaO2M8t1DdYaq3zPUCASkq1FTHi+HuBOUcCjRjjmNc0qzs97bpDf9kO Oxa2t4/LF8rTAZGGIDNXf9h+SDZcExNiYQGRLUUOJOIejwWQ3cbyMb0oRdQTWlnJsQ4f J8Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723498403; x=1724103203; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mWrLCokxS0NRWFwWq6GAU7ooSoM/6W76Lkh+xM5Kh1k=; b=XHmFGe1SKne38ufp+Xq/agwG0mchl19dTtM1oaMYBYkBpV0pRccZUjnPmnWsKZxRms CgQ81WRHWgL+TqWyeb/egCD6kyMeEYIWJqOwX8u6rUEgVyorzukVMWPUm5ZRsS3XjppB hg8EMFqjHiQGqgDFA70up7//Y1ZpnbCNG1jgNG8msIpByVlKzqpjqCVyG5lHe1DHfeW8 xfMZ7nQ+EexSUEXr353SRvpORgdEBqGAsHXaiTT0If3SGOm02PgXlr6RH9gKWj6fOSoZ CPgqGxGZCGMjnaJsTFKrhayYTBnomfPgqrXDXzy+d4cF96XYTXpR+VreAqB9iY3ndVUj pmMw== X-Forwarded-Encrypted: i=1; AJvYcCW/s6mg0HWihbR/sd/kIphgARLVCU7sYPxvmwxAgxzufFC7xynRXnAugo3h2UhrCNCaDekFZ3sO/yI0pr2MVegFXuQ/MxAa3E6TSwWoK1QdxAVX X-Gm-Message-State: AOJu0YyRu+xMgarXLdWxJwLRjoFMpd8F3KoOWULVIYTPbXk6o0xoUbB5 VSA3yRS4eFSnQcuNPhOFCo8fRCEojAZ359mz0RX/ov0rKtytI/K/7ckgXZUABqv4X92W6QaAxA0 bW5YU6HNoGT1mteA14vUqpFPS8Zg= X-Google-Smtp-Source: AGHT+IHprAcFJR2V8lke21NX2QoIi+LgmevJeq8HmeNoFrQioN8O/vy24RN0mC0NcohdypJ818RpmUDZaTdd640nOdQ= X-Received: by 2002:a2e:be88:0:b0:2f1:75f4:a6a4 with SMTP id 38308e7fff4ca-2f2baadb453mr1245721fa.3.1723498402344; Mon, 12 Aug 2024 14:33:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiko Sawada Date: Tue, 13 Aug 2024 06:32:45 +0900 Message-ID: Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation To: Nathan Bossart Cc: Bharath Rupireddy , Amit Kapila , Bertrand Drouvot , shveta malik , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 9, 2024 at 3:01=E2=80=AFPM Nathan Bossart wrote: > > On Mon, Jun 24, 2024 at 11:30:00AM +0530, Bharath Rupireddy wrote: > > 6) Vacuum command can't be run on the standby in recovery. So, to help > > invalidate replication slots on the standby, I have for now let the > > checkpointer also do the XID age based invalidation. I know > > invalidating both in checkpointer and vacuum may not be a great idea, > > but I'm open to thoughts. > > Hm. I hadn't considered this angle. Another idea would be to let the startup process do slot invalidation when replaying a RUNNING_XACTS record. Since a RUNNING_XACTS record has the latest XID on the primary, I think the startup process can compare it to the slot-xmin, and invalidate slots which are older than the age limit. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com