Re: pg_upgrade & tablespaces

From: Joseph Kregloh <jkregloh(at)sproutloud(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_upgrade & tablespaces
Date: 2013-12-20 18:42:24
Message-ID: CAAW2xferCZkJi6BOo1DJXFvqTS+vfy6y+qK8KTZM7Ob_JMbzTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> So was your latest attempt where you ended up with a doubled data/ in the
> two or one jail scenario?
>
>
The two jails scenario. The two jail scenario is the same as the mounted
scenario.

Can we see a directory listing for that case?
>
> You say in the single jail case you got the same results. Which would that
> be the failure, the double data/ or both ?
>
>
>>
Let's break this down between the two cases.

Case A:
pg_upgrade -b /home/jkregloh/pg_bin/ -B /usr/local/bin/ -d
/home/jkregloh/pg_data/data -D /usr/local/pgsql/data/ -p 5452 -P 5451

[root(at)postgres-93-upgrade /usr/local/pgsql/data/drupal_dbspace]# ls -la
drwx------ 3 pgsql pgsql 3 Dec 19 20:18 PG_9.3_201306121

[root(at)postgres-93-upgrade /usr/local/pgsql/data/drupal_dbspace]# ls -la
/home/jkregloh/pg_data/data/drupal_dbspace/
drwx------ 4 pgsql pgsql 4 Oct 20 2011 PG_9.0_201008051

Case B:
pg_upgrade -b /home/jkregloh/pg_bin/ -B /usr/local/bin/ -D
/usr/local/pgsql_93/data -d /usr/local/pgsql/data/ -P 5452 -p 5451

[pgsql(at)postgres-93-upgrade /usr/local/pgsql_93/data/drupal_dbspace]$ ls -la
/usr/local/pgsql/data/drupal_dbspace/
drwx------ 4 pgsql pgsql 4 Oct 20 2011 PG_9.0_201008051
drwx------ 3 pgsql pgsql 3 Dec 20 16:44 PG_9.3_201306121

[pgsql(at)postgres-93-upgrade /usr/local/pgsql_93/data/drupal_dbspace]$ ls -la
/usr/local/pgsql_93/data/drupal_dbspace/

drwxr-xr-x 2 pgsql pgsql 2 Dec 20 16:43 .

So it did the changes in the /usr/local/pgsql/data dir. Which contains the
9.0 install. pg_upgrade was almost successful, some stuff it did not do as
I will show at the end of this email.

It created the symlinks for the 9.3 folders:
[pgsql(at)postgres-93-upgrade /usr/local/pgsql_93/data/drupal_dbspace]$ ls -la
/usr/local/pgsql_93/data/pg_tblspc/
lrwx------ 1 pgsql pgsql 36 Dec 20 16:44 16452 ->
/usr/local/pgsql/data/drupal_dbspace

When I start Postgres 9.3:
[pgsql(at)postgres-93-upgrade /usr/local/pgsql_93/data/drupal_dbspace]$
/usr/local/bin/postgres -D /usr/local/pgsql_93/data

I am able to connect to the server however running a simple query I get:
ERROR: relation "sys_errors" does not exist
LINE 1: SELECT * FROM sys_errors ORDER BY created_ts DESC LIMIT 100;
^
********** Error **********

ERROR: relation "sys_errors" does not exist
SQL state: 42P01
Character: 15

Below is the output of the execution of Case B:

[pgsql(at)postgres-93-upgrade /tmp]$ pg_upgrade -b /home/jkregloh/pg_bin/ -B
/usr/local/bin/ -D /usr/local/pgsql_93/data -d /usr/local/pgsql/data/ -P
5452 -p 5451
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is a superuser ok
Checking for prepared transactions ok

If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.

Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows on the new cluster ok
Deleting files from new pg_clog ok
Copying old pg_clog to new server ok
Setting next transaction ID for new cluster ok
Setting oldest multixact ID on new cluster ok
Resetting WAL archives ok
Setting frozenxid counters in new cluster ok
Restoring global objects in the new cluster ok
Adding support functions to new cluster ok
Restoring database schemas in the new cluster
ok
Removing support functions from new cluster ok
Copying user relation files
ok
Setting next OID for new cluster ok
Sync data directory to disk ok
Creating script to analyze new cluster ok

Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
analyze_new_cluster.sh

Could not create a script to delete the old cluster's data
files because user-defined tablespaces exist in the old cluster
directory. The old cluster's contents must be deleted manually.
[pgsql(at)postgres-93-upgrade /tmp]$

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anand Kumar, Karthik 2013-12-20 19:33:09 Re: Best way to sync possibly corrupted data?
Previous Message Jeff Janes 2013-12-20 17:30:55 Re: pg_upgrade & tablespaces

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-12-20 19:10:57 Re: shared memory message queues
Previous Message Alvaro Herrera 2013-12-20 18:41:24 Re: preserving forensic information when we freeze