Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3sXQ-0004il-Tu for pgsql-general@arkaria.postgresql.org; Thu, 05 Apr 2018 00:14:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f3sXP-0002IN-6y for pgsql-general@arkaria.postgresql.org; Thu, 05 Apr 2018 00:13:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3sXO-0002IC-JS for pgsql-general@lists.postgresql.org; Thu, 05 Apr 2018 00:13:58 +0000 Received: from resqmta-ch2-12v.sys.comcast.net ([2001:558:fe21:29:69:252:207:44]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3sXH-00056T-5O for pgsql-general@postgresql.org; Thu, 05 Apr 2018 00:13:57 +0000 Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id 3sVffqx1voWpd3sXEfl1kw; Thu, 05 Apr 2018 00:13:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1522887228; bh=jqLy9T/XxSHxXNYA27i7fOjLcW/KPelyA/yYYIYKK9w=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=PTGbswprQ6dS2VTxcz2gohRRv895o0AHVBIEp0schPb0d8pjvgAPqyUpaAXqU2dqY L08eSqp55qaxYVJqriPC6nTB4Ve42DwGzTX2q/7nnw1Mba+9WRfv4238+2P5P8Ugby 1RDm7hyZry1PI6jePlSsgWDP7CT216QHYZS9YBKfudzijPZljjq0ZdbMGhS5lZsR60 QwgZ3VRAgVzuscf15hcMFY9EXRMUKV15fAsZ6dcxUceReewkMGtazjA9s6aRK2QIpA 8Xm1C9MjffWmh5Qxz0omTePCTnBWT0XNi8AImz1nQBw+BkwS4OugOAsIlx/Bvicv6e tYYm4Zm+EkqpQ== Received: from jsievers.comcast.net ([12.30.159.20]) by resomta-ch2-02v.sys.comcast.net with SMTP id 3sX2f9NRqbdGJ3sX4f0JYC; Thu, 05 Apr 2018 00:13:46 +0000 Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 1657E260056; Wed, 4 Apr 2018 19:13:36 -0500 (CDT) From: Jerry Sievers To: Bruce Momjian Cc: Jerry Sievers , pgsql-general@postgresql.org Subject: Re: PgUpgrade bumped my XIDs by ~50M? References: <87sh8a7gh1.fsf@jsievers.enova.com> <20180404232827.GD19574@momjian.us> Date: Wed, 04 Apr 2018 19:13:36 -0500 In-Reply-To: <20180404232827.GD19574@momjian.us> (Bruce Momjian's message of "Wed, 4 Apr 2018 19:28:27 -0400") Message-ID: <87k1tm7bnz.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfJGSgYSYDeiwWrfU5NaqnDDXUVTWIbUMtFrphUOix5uafBx1qSExFk6+97slbaBdUJJbF5xxoGjSEcNRA5FZwixqnGQ58Q/3ss41/NTbNcrLhrxU/E5i pLHnF14WI+Q/ayryup6oR6iRKweCV7aTgFQpzV/ztp7rKZiZbrIt+eKYIDcnLsYM7eHQaAZQv2XpanVFMU+DJVIDMrLWP09kakAKjRSarbbUMylhHUbWra1o M+Wllqp/lqhAbz6aImxTaw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > On Wed, Apr 4, 2018 at 05:29:46PM -0500, Jerry Sievers wrote: > >> We have a large >20TB system just pg_upgraded from 9.5 to 9.6 as per the >> versions shown below. >> >> The system does <5M transactions/day based on sum(commit + abort) from >> pg_stat_database. >> >> Autovac is running all possible threads now and upon investigating I see >> that thousands of tables are now above the freeze threshold. Same >> tables all appear ~50M xids older than they did yesterday and the >> upgrade was less than 24 hours ago. >> >> I have a "safety" snap made of the system before upgrade that can be >> used for inspection. >> >> Any ideas why the age jump? > > Uh, you can read how pg_upgrade handles frozen xids in pg_upgrade.c: > > https://doxygen.postgresql.org/pg__upgrade_8c_source.html#l00543 > > I am not sure what would have caused such a jump. pg_upgrade brings > over the frozen values for each table, and sets the server's frozen > counter to match the old one. > > If you run 'pg_dump --binary-upgrade' you will see the frozen xids being > transfered: > > -- For binary upgrade, set heap's relfrozenxid and relminmxid > UPDATE pg_catalog.pg_class > SET relfrozenxid = '558', relminmxid = '1' > WHERE oid = 'public.test'::pg_catalog.regclass; > > Is it possible that pg_upgrade used 50M xids while upgrading? Hi Bruce. Don't think so, as I did just snap the safety snap and ran another upgrade on that. And I also compared txid_current for the upgraded snap and our running production instance. The freshly upgraded snap is ~50M txids behind the prod instance. If this is a not too uncommon case of users running amok, then this time in particular they really went off the charts :-) Will investigate... FYI, this is the same system that a few weeks ago issued complaints during vacuum of an XID younger than relfrozenxid, which a system restart did mysteriously resolve. I hope we're going to be OK here. Thx -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800