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 1r0peW-0083Nq-8q for pgsql-general@arkaria.postgresql.org; Wed, 08 Nov 2023 20:59:56 +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 1r0peU-007fwc-T9 for pgsql-general@arkaria.postgresql.org; Wed, 08 Nov 2023 20:59:54 +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 1r0peU-007fwU-Cr for pgsql-general@lists.postgresql.org; Wed, 08 Nov 2023 20:59:54 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r0peR-005PrF-Uv for pgsql-general@lists.postgresql.org; Wed, 08 Nov 2023 20:59:53 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50939d39d0fso158376e87.1 for ; Wed, 08 Nov 2023 12:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1699477190; x=1700081990; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=QIo+vbCq6M9kKtTFsEDhiyBx6jB22bkMH+cymhqz5gY=; b=FqMFZEtbrRaei7EZGGMbmbBrlk1XCwR9Y7QrqI++UVLe6zsdPb9+wUfeBi0RnUFYr9 QtjqkiLBxEoJAoqdUsD0r5SAMeWt9pfBxvIv1FmdJRVK8O+u2cjpiDCsaFgehwpGVkOd 55U+w3RAfO9witD07CU8qylMWcAFkz9YRuREESFcrnR/kkJXqj75oZEWxyRgcAnFE1fQ r8LH/+30EjTHpmjvQNmbVVOp+9jGAe5tCDKRTi8F77zuFW9ZpNNib69xu/HRSxx/25+0 unn7xH1HIIxPGXoeUyRJOufntJLGWic6R5TEANdEXfAlDtrhGIT+Yg+Czye6YRGd4n/5 ykgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699477190; x=1700081990; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QIo+vbCq6M9kKtTFsEDhiyBx6jB22bkMH+cymhqz5gY=; b=OsdMREfKLUMGvLYTdQ2P5vf0ICfGuIwerJqeWxkk92H82ZFDiMx1HNXJH3Rv9nl++U kMw2bhoY0cnNMhoTZySoxfLEaPqASL7BAW0B2f7BxJfweJL/cOWVwt34IKwu3zjCnH3f a1b7pSm0Wmfjyo9Fq7WcIhHg0QSpAgfB/LXpkYUGXN8JdOjwquBi0VBBWWqAAoRif8iz 63//mB9BUu/XEEKR5TztpCatxxoFmn8oVu/G19+jx1XzNTLpV8dPNTqE3qKtQ5BTAxpF RZFZqZgtNUa1zspsdAxo3N//pTORggr+Vfw3NM50EV2XkRdE8kKDBlfumIDwN4x3fB+m XgUg== X-Gm-Message-State: AOJu0Yx/ZaihpY6Npoc5tUdrsZm35HxyC/c8gG1cSQH+LvAHT0y818gw zNBz87Psi6+6BsOr0eK+GohtRb0Nq8YrtEupbQzDcA== X-Google-Smtp-Source: AGHT+IFpLFk0x3Q51T0vuK+99qFdrd6EH/uVClcF688I569GhSIYalU6ZUa17APEAGJvPtCmvTE1fg== X-Received: by 2002:a05:6512:104b:b0:507:a1b3:2d47 with SMTP id c11-20020a056512104b00b00507a1b32d47mr2747124lfb.17.1699477189866; Wed, 08 Nov 2023 12:59:49 -0800 (PST) Received: from localhost.localdomain ([2001:871:260:ea1f:cf3b:8147:9c04:e8f1]) by smtp.gmail.com with ESMTPSA id m26-20020a05600c3b1a00b00407752bd834sm20700122wms.1.2023.11.08.12.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 12:59:49 -0800 (PST) Message-ID: Subject: Re: Maximum xid increasing From: Laurenz Albe To: Craig Milhiser , pgsql-general@lists.postgresql.org Date: Wed, 08 Nov 2023 21:59:48 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-11-08 at 09:09 -0500, Craig Milhiser wrote: > Our max xid are over 500m and climbing. Auto vacuuming and manual=C2=A0va= cuuming=C2=A0are returning >=20 > autovacuuming=C2=A0to prevent wraparound. > WARNING: =C2=A0oldest xmin is far in the past > HINT: =C2=A0Close open transactions soon to avoid wraparound problems. > You might also need to commit or roll back old prepared transactions, or = drop stale replication slots. >=20 > The autovacuum previously kicked in at 200m and reduced the maximum xid. = =C2=A0 Now there is no reduction. >=20 > We have a writer (master) node, 3 readers (slaves) and a=C2=A0hot-standby= . We have an ETL vendor hooked > up to replicate. All of the replications are working. There is current da= ta in each. We have checked > our replication slots. Everything is in use and working. >=20 > From transactions, we have terminated every writer node PID since before = this climb has started. > Almost every client has been restarted.=C2=A0 >=20 > We are handling 100+ insert/updates per second. Most transactions complet= e in ~2 seconds. Though some > may take 1 minute.=C2=A0 There are no long running idle in transaction ac= tivities.=C2=A0 >=20 > We have been scouring the internet reading many helpful pages and trying = their advice but we cannot > find a problem. >=20 > We have restored a daily snapshot in another cluster. After vacuuming the= max xid dropped to 50m. > No client was connected. Implying that a restart should fix the issue. >=20 > I am searching for any hints. We have not found a smoking=C2=A0gun to foc= us on.=C2=A0 This is a 24x7 operation > and would rather not have to restart the server. >=20 > We are on v13.8, AWS RDS. >=20 > Is there a way to find which row or table or lock or some open transactio= n is preventing the vacuuming > from lowering xid? Any hints on where to look?=C2=A0 If that is not a bug introduced by Amazon, and you are certain that there a= re no long-running transactions and stale replication slots, there are two more possibilities: 1. a prepared transaction (check pg_prepared_xacts) 2. a long-running query on a standby, and "hot_standby_feedback =3D on" Yours, Laurenz Albe