Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fRjkM-0003qt-Kq for pgsql-general@arkaria.postgresql.org; Sat, 09 Jun 2018 19:41:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fRjkK-0006Rn-M5 for pgsql-general@arkaria.postgresql.org; Sat, 09 Jun 2018 19:41:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fRjkJ-0006Rd-1O for pgsql-general@lists.postgresql.org; Sat, 09 Jun 2018 19:41:56 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fRjkD-00078O-EY for pgsql-general@postgresql.org; Sat, 09 Jun 2018 19:41:54 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F4074218C8; Sat, 9 Jun 2018 15:41:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 09 Jun 2018 15:41:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=hosfCTV7opIpGEgmHQ3M/6/2RGGHJ 3el7VaVAqK6bpA=; b=A97TJwwBVpWWUsYJyl3F6Y5T2FecSkRFpyTzp4Hl1oeKz izdRIZ36lHRHf6rYUthz1Ev23uj3UP9c7SAR11KH2iEN2s3GJI1wAMvGajbfxs5L sUXfDddUTTOkdNZBy+VywUY4T0XKlGq78WHJWrtp6b7mxAQN9509dj/rI/Op07bC Mu0iKS744kEuCyMUkn0Un4jwYo5iRckTomjmJewBEyq8W46sUnV3qxkS0bUwtQIv yOQXBlHMcFbckHiB+D/iswI95VdhgHCCIIkSAVt3+XC9w4EhYNiFy6zWEtKsSvIE zvoDWKqk6oo8C9rugDHdNNnV0x+u5ey7YQTeW9xpw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=hosfCT V7opIpGEgmHQ3M/6/2RGGHJ3el7VaVAqK6bpA=; b=IFksPM5cvXs9L+qTVgDpAY BVNPRQ6TxZRMtDfrYvHCk94OCk+iW/pqdvwO+AOgGLts76HFc+iqtSg22Vg4tvEV xdMaVvz+gWNcRbltikunSZeqDCRYmqlYOXCEw7G1Js6ysxr0WjfVL1dZydPFy85N lv1JlXlZFp6T0v5X5GxpPs3/iWSH50lO93O3rBqb9+jLQ8RzdZ03ZkHoig11dPgg Kp/H94Ej3BlmmHtkf5Yz9ud0IOGIzg27BrwjRFe3LfZ1D88mjN+9T8DrqqDIu6e4 0YqvhVsyBhR3TsgDZ3P50wDw24eMoMFarG95eHi6KUGPkMRPCdyLKBzolC8qvWuw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id 3D314E4923; Sat, 9 Jun 2018 15:41:45 -0400 (EDT) Subject: Re: pg_upgrade and wraparound To: Alexander Shutyaev , pgsql-general References: From: Adrian Klaver Message-ID: <107c7c17-2e53-6cd1-1dbd-94d63f7a205f@aklaver.com> Date: Sat, 9 Jun 2018 12:41:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/09/2018 03:46 AM, Alexander Shutyaev wrote: > Hello! > > I've been trying to upgrade a postgresql cluster from 9.6 to 10. I've > executed the pg_upgrade with the following options: > >  /usr/lib/postgresql/10/bin/pg_upgrade -b /usr/lib/postgresql/9.6/bin/ > -B /usr/lib/postgresql/10/bin/ -d /var/lib/postgresql/9.6/main -D > /var/lib/postgresql/10/main -o ' -c > config_file=/etc/postgresql/9.6/main/postgresql.conf' -O ' -c > config_file=/etc/postgresql/10/main/postgresql.conf' > > The upgrade operation failed after several hours with the following error: > > database is not accepting commands to avoid wraparound data loss in > database with OID 0 Do you know which database has an OID of 0? > > Earlier in the log there are a lot of messages like > > pg_restore: executing BLOB 1740736966 > pg_restore: WARNING:  database with OID 0 must be vacuumed within > 1000279 transactions > HINT:  To avoid a database shutdown, execute a database-wide VACUUM in > that database. > You might also need to commit or roll back old prepared transactions. > pg_restore: WARNING:  database with OID 0 must be vacuumed within > 1000278 transactions > HINT:  To avoid a database shutdown, execute a database-wide VACUUM in > that database. > You might also need to commit or roll back old prepared transactions. > > I've tried to do VACUUM FULL on my 9.6 cluster on all databases and then > retried the pg_upgrade - it failed in the same way. > > Also to be noted, earlier this cluster was succesfully upgraded with > pg_upgrade using similar parameters from older versions (at least 2 > times, something like 9.1 -> 9.3, 9.3 -> 9.6). The database is around > 700 GB and has very many pg_largeobjects in it. > > What could be the reason of this and how can I perform my upgrade? > > Thanks in advance, > Alexander -- Adrian Klaver adrian.klaver@aklaver.com