Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7RWP-00041I-Dy for pgsql-general@arkaria.postgresql.org; Wed, 03 Feb 2021 23:25:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7RWO-0006U5-8T for pgsql-general@arkaria.postgresql.org; Wed, 03 Feb 2021 23:25:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7RWN-0006Ty-T0 for pgsql-general@lists.postgresql.org; Wed, 03 Feb 2021 23:25:16 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l7RWL-0000M5-5K for pgsql-general@lists.postgresql.org; Wed, 03 Feb 2021 23:25:15 +0000 Received: by mail-wr1-x429.google.com with SMTP id u14so1320354wri.3 for ; Wed, 03 Feb 2021 15:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornfield-me-uk.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=7tz7C9mGzRQo3wFhipFrUaRRcPtIpiyPRpErCz/a/rs=; b=WL1Xuu/6XIOo6/eN7tO5zOz3RYBqm4mFS2xk9/PpU/8uNxXuH1sSovEO7x/xQxltP3 Iir9CaWTZ+Y1Ps4Gbt2Vfsr6MbHWBYkx5kC/tEZkkzoMFWdalHLjgbjUu1cvz4gBNqJ3 Hg41FIxUyt9Jtuz0lTyHIUMZZrMiqjI838Oj07NiGmE/HJHhPSmZDs81lX6jFbzC+zAt E+spCWwuvn4o35h8o69S5WzwQEPGBvg5c2mxikzmH7CUrHmX6WvZnZowJE12qaADxt4i JvHAoaqJT/QL56Y6sGR1mbRWoOTCarl7VU/kt7nWjLfk3g5FilXc03iAv5IpKkzPQb5C NCIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=7tz7C9mGzRQo3wFhipFrUaRRcPtIpiyPRpErCz/a/rs=; b=Kq9DvQWT9P1TQqhfjdciqycdyfcTL5FcIRPwrR8brDnCr1b/OFo/lBZBnvAiB6VDq/ VR2vXzeaEVv3NGjMF14wdO8hymiAVH1UTejFitZI4R6gb7SszsLkgPRnCHHZadh/dwVp 00qH1gdZDQ9DtIfC88F7Y/lLyhiwP/P0tMUK+JRIbTLJCoGGKVJkJSo6FvMK9PPKGWpW H+e3GnrzZPGFP1Ssqu5kM++jb+RjevPDddHE6/9SO2rvEALwO1drMv8lzg88m9YRXqPa eaW8tIg1osahKSCSH0v3EpWNCy61sQNcI24I18VCAcJJePPhiMCiDUa9MrT76LX8HLFQ TCaA== X-Gm-Message-State: AOAM531CjRB1klFYAJHOu90/W+JK81+0dZzjfkgEWGoPDikLKRQj4tys +aWiynaw5Cj7j/XslCOhpjNMz2UQDjDibQ== X-Google-Smtp-Source: ABdhPJx/eMqrWSZ8V95kwRURPQpWqJWOpI64V3nJPJEZZ17HmDjEBPChw6Nf5O3Sgc70fafs+zt00w== X-Received: by 2002:a5d:4806:: with SMTP id l6mr6170947wrq.389.1612394711885; Wed, 03 Feb 2021 15:25:11 -0800 (PST) Received: from [192.168.86.122] (cpc97476-aztw32-2-0-cust126.18-1.cable.virginm.net. [86.29.127.127]) by smtp.gmail.com with ESMTPSA id n9sm5797619wrq.41.2021.02.03.15.25.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 15:25:11 -0800 (PST) To: pgsql-general@lists.postgresql.org From: Simon Windsor Subject: Database upgrade Pg11 to Pg12 issues Message-ID: <8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk> Date: Wed, 3 Feb 2021 23:25:11 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------2A9AF2D03313F8AB2DBF5ADE" Content-Language: en-GB List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------2A9AF2D03313F8AB2DBF5ADE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi I have upgraded many Pg databases from 9 to 10 to 11 using the Ubuntu pg_upgradecluster command (wrapper to pg_update) without issues, however today I upgraded a DB from 11 to 12. Using the syntax */pg_upgradecluser -k -m upgrade 11 main/* using the latest 12.5 binaries all appeared to work well, and for a 330G DB this took 2 minutes. On starting the DB using systemctl start postgresql@12.service the DB started, but the screen showed the default directory was *//var/lib/postgresql/11/main/*. Checking the open database with /*show data_directory; */gave /*/var/lib/postgresql/12/main*/ Then using /*lsof | grep '11/main'*/ gave no files, but/*lsof | grep '12/main'*/ gave over 30K files, Checking the directory sizes suggests that 11/main is 300G and 12/main is 40G So all appears OK, with files hard linked between 11/main and 12/main, and I assume the issue relates to the PGDATA/postgresql.auto.conf file being just copied from the original 11/main with data_directory being set to /var/lib/postgresql/11/main. If I where to run /*pg_dropcluster 11 main*/ to remove the old database and conf files, will this destroy my running Pg12 database with hard linked files in 11/main and 12/main? In theory it shouldn't and files from 11/main and 12/main will all be under 12/main, I just have doubts. Is there an easy way to tidy this up? Simon -- Simon Windsor Eml: simon.windsor@cornfield.me.uk “There is nothing in the world that some man cannot make a little worse and sell a little cheaper, and he who considers price only is that man's lawful prey.” --------------2A9AF2D03313F8AB2DBF5ADE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi

I have upgraded many Pg databases from 9 to 10 to 11 using the Ubuntu pg_upgradecluster command (wrapper to pg_update) without issues, however today I upgraded a DB from 11 to 12.

Using the syntax

pg_upgradecluser -k -m upgrade 11 main

using the latest 12.5 binaries all appeared to work well, and for a 330G DB this took 2 minutes. On starting the DB using

systemctl start postgresql@12.service

the DB started, but the screen showed the default directory was /var/lib/postgresql/11/main. Checking the open database with

show data_directory; gave /var/lib/postgresql/12/main

Then using lsof | grep '11/main' gave no files, but lsof | grep '12/main' gave over 30K files, Checking the directory sizes suggests that 11/main is 300G and 12/main is 40G

So all appears OK, with files hard linked between 11/main and 12/main, and I assume the issue relates to the PGDATA/postgresql.auto.conf file being just copied from the original 11/main with data_directory being set to /var/lib/postgresql/11/main.

If I where to run pg_dropcluster 11 main to remove the old database and conf files, will this destroy my running Pg12 database with hard linked files in 11/main and 12/main? In theory it shouldn't and files from 11/main and 12/main will all be under 12/main, I just have doubts.

Is there an easy way to tidy this up?

Simon


-- 
Simon Windsor

Eml: simon.windsor@cornfield.me.uk


“There is nothing in the world that some man cannot make a little worse and sell a little cheaper, and he who considers price only is that man's lawful prey.”
--------------2A9AF2D03313F8AB2DBF5ADE--